Description: Install and configure network interfaces using netplan for debian-based distros.
| Field | Value |
|---|---|
| Readme update | 09/05/2025 |
These are static variables with lower priority
| Var | Type | Value | Required | Title |
|---|---|---|---|---|
| manage_netplan_config_file | str | /etc/netplan/ansible-config.yaml |
false | Netplan configuration file |
| manage_netplan_renderer | str | networkd |
false | Netplan renderer |
| manage_netplan_remove_existing | bool | False |
false | Remove existing configurations |
| manage_netplan_install | bool | True |
false | Manage Netplan installation |
| manage_netplan_apply | bool | False |
false | Apply Netplan configuration |
| manage_netplan_configuration | dict | {} |
true | Netplan configuration |
🖇️ Full descriptions for vars in defaults/main.yml
manage_netplan_config_file: Specifies the file path for the Netplan configuration.
The file must have a .yaml extension, as some Netplan versions may not support .yml.
manage_netplan_renderer: Defines the backend used by Netplan to apply network settings.
Possible values are 'NetworkManager' or 'networkd'.
manage_netplan_remove_existing: Determines whether to delete all existing Netplan configurations before applying new ones.
Set to true to remove all configurations in /etc/netplan.
manage_netplan_install: Controls whether the Netplan package should be installed.
Set to true to ensure Netplan is installed.
manage_netplan_apply: Specifies whether to apply the Netplan configuration after changes are made.
Set to true to automatically apply the configuration.
manage_netplan_configuration: Defines the Netplan configuration as a dictionary.
Use this to specify the desired network settings.
These are variables with higher priority
| Var | Type | Value | Required | Title |
|---|---|---|---|---|
| manage_netplan_packages | list | [{'name': 'netplan.io', 'version': 'latest', 'state': 'present'}] |
false | Netplan packages |
| manage_netplan_networkmanager_pkg | list | [{'name': 'network', 'version': 'latest', 'state': 'present'}] |
false | NetworkManager packages |
🖇️ Full Descriptions for vars in vars/main.yml
manage_netplan_packages: List of packages necessary for Netplan functionality
manage_netplan_networkmanager_pkg: List of packages required to enable NetworkManager functionality
| Name | Module | Has Conditions |
|---|---|---|
| Netplan ¦ Copy netplan configuration template into {{ manage_netplan_config_file }} | ansible.builtin.template | True |
| Netplan ¦ Set generate-check and apply-check variables | ansible.builtin.set_fact | True |
| Name | Module | Has Conditions |
|---|---|---|
| Netplan ¦ Install netplan:latest | ansible.builtin.include_role | False |
| Netplan ¦ Install network-manager:latest when used as renderer | ansible.builtin.include_role | True |
| Netplan ¦ Create directory /etc/netplan | ansible.builtin.file | False |
| Name | Module | Has Conditions |
|---|---|---|
| Netplan ¦ Set generate-check and apply-check variables | ansible.builtin.set_fact | False |
| Netplan ¦ Import install.yml | ansible.builtin.include_tasks | True |
| Netplan ¦ Import remove_existing.yml | ansible.builtin.include_tasks | True |
| Netplan ¦ Import configure.yml | ansible.builtin.include_tasks | False |
| Netplan ¦ Generate netplan configuration | ansible.builtin.command | True |
| Netplan ¦ Apply netplan configuration | ansible.builtin.command | True |
| Name | Module | Has Conditions |
|---|---|---|
| Netplan ¦ Fetch existing configurations | ansible.builtin.find | False |
| Netplan ¦ Remove existing configurations | ansible.builtin.file | True |
Bertrand Lanson
license (BSD, MIT)
2.10
- Ubuntu: ['focal', 'jammy', 'noble']
- Debian: ['bullseye', 'bookworm']
No dependencies specified.