Ansible role to manage network configuration using netplan on debian-based systems. https://ednz.fr
Go to file
Bertrand Lanson 5ab6aecc9c
All checks were successful
test / Linting (push) Successful in 8s
test / Molecule tests (default, debian11) (push) Successful in 56s
test / Molecule tests (default, debian12) (push) Successful in 49s
test / Molecule tests (default, ubuntu2004) (push) Successful in 57s
test / Molecule tests (default, ubuntu2204) (push) Successful in 49s
test / Molecule tests (with_custom_config, debian11) (push) Successful in 51s
test / Molecule tests (with_custom_config, debian12) (push) Successful in 52s
test / Molecule tests (with_custom_config, ubuntu2004) (push) Successful in 56s
test / Molecule tests (with_custom_config, ubuntu2204) (push) Successful in 52s
fix readme
2023-07-11 22:53:36 +02:00
.gitea/workflows add debian 12 support, gitea actions, and linting 2023-07-08 22:59:36 +02:00
.github/workflows adding to galaxy 2023-04-15 18:45:17 +02:00
defaults added sample file and example for netplan conf variable 2023-04-15 23:27:27 +02:00
files fix linting job 2023-04-26 23:20:33 +02:00
handlers fixed handlers not applying netplan config 2023-04-15 23:57:38 +02:00
meta fix tests 2023-07-09 01:05:25 +02:00
molecule removed python tests 2023-07-10 23:56:31 +02:00
tasks do not escalate privileges on install prereqs 2023-05-28 13:44:14 +02:00
templates added my previous netplan role code 2023-04-11 23:32:34 +02:00
vars added my previous netplan role code 2023-04-11 23:32:34 +02:00
.ansible-lint added some of the default files 2023-04-12 21:50:54 +02:00
.gitignore ignore .vscode 2023-05-21 20:16:14 +02:00
.yamllint added some of the default files 2023-04-12 21:50:54 +02:00
LICENSE add debian 12 support, gitea actions, and linting 2023-07-08 22:59:36 +02:00
README.md fix readme 2023-07-11 22:53:36 +02:00

manage_netplan

This repository is only a mirror. Development and testing is done on a private gitea server.

This role install and configure network interfaces using netplan for debian-based distributions.

Requirements

None.

Role Variables

Available variables are listed below, along with default values. A sample file for the default values is available in default/hashicorp_consul.yml.sample in case you need it for any group_vars or host_vars configuration.

manage_netplan_config_file: /etc/netplan/ansible-config.yaml # by default, set to /etc/netplan/ansible-config.yaml

This variable defines the path and file name that'll be used to copy over the netplan configuration.

manage_netplan_renderer: networkd # by default, set to networkd

This variable defines the renderer that'll be used by netplan. Defaults to networkd, but NetworkManager is also an option.

manage_netplan_remove_existing: false # by default, set to false

This variable defines whether or not to remove all existing netplan configuration when applying the new one. Defaults to false.

manage_netplan_search_domain: example.org #by default, set to example.org

This variable defines the search domain to use in case you want to specify dns resolution inside of your netplan configuration. This can be left untouched if you do not intend to use it.

manage_netplan_install: true # by default, set to true

This variable defines whether or not to install netplan and related packages when running this role. It is recommended to not change it to ensure that netplan and eventually NetworkManager are installed. If you are already making sure that these packages are installed elsewhere, you can set this to false.

manage_netplan_apply: true # by default, set to true

This variable defines whether or not to apply the netplan configuration once it has been written to the target system. Defaults to true.

manage_netplan_configuration: {} # by default, set to {}

This variable contains the content of your netplan file in yml format. This what will be used to generate the configuration file on the target host. An example file for this variable is available in files/netplan_conf_example.yml.

Dependencies

This role has a task that installs its own dependencies located in task/prerequisites.yml, so that you don't need to manage them. This role requires ednxzu.manage_apt_packages to install netplan and eventually network-manager if needed.

Example Playbook

# calling the role inside a playbook with either the default or group_vars/host_vars
- hosts: servers
  roles:
    - ednxzu.manage_netplan

License

MIT / BSD

Author Information

This role was created by Bertrand Lanson in 2023.