Skip to content

ednz-cloud/manage_netplan

Repository files navigation

📃 Role overview

manage_netplan

Description: Install and configure network interfaces using netplan for debian-based distros.

Field Value
Readme update 09/05/2025

Defaults

These are static variables with lower priority

File: defaults/main.yml

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.


Vars

These are variables with higher priority

File: vars/main.yml

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

Tasks

File: tasks/configure.yml

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

File: tasks/install.yml

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

File: tasks/main.yml

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

File: tasks/remove_existing.yml

Name Module Has Conditions
Netplan ¦ Fetch existing configurations ansible.builtin.find False
Netplan ¦ Remove existing configurations ansible.builtin.file True

Author Information

Bertrand Lanson

License

license (BSD, MIT)

Minimum Ansible Version

2.10

Platforms

  • Ubuntu: ['focal', 'jammy', 'noble']
  • Debian: ['bullseye', 'bookworm']

Dependencies

No dependencies specified.

About

Ansible role to manage network configuration using netplan on debian-based systems. Mirror from https://git.ednz.fr/ansible-roles/manage_netplan.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages