hifis.netplan
Netplan Role
:warning: This project is no longer active! :warning:
This role has been moved to our hifis.toolkit
collection:
- https://github.com/hifis-net/ansible-collection-toolkit
- https://galaxy.ansible.com/ui/repo/published/hifis/toolkit/
Ansible role to set up and configure Netplan.
Requirements
None.
Role Variables
Required Variables That Must Be Set
Example Network Setup
Here is an example configuration to set up networking with Netplan:
netplan_ethernets:
- interface_name: 'eth0'
dhcp4: 'no'
routes:
- to: 'default'
via: '10.123.0.1'
addresses:
- '10.123.0.10/24'
nameservers:
addresses:
- '8.8.8.8'
- '9.9.9.9'
search:
- 'domain.local'
- 'domain.name'
Variables With Default Values
Option to Remove Old Netplan Configuration Files
This option determines if old Netplan configuration files should be deleted:
netplan_remove_existing_configs: true
Name of the Template for the Netplan Configuration File
This is the name of the template that provides the Netplan configuration file:
netplan_configuration_file_template: 'config.yaml.j2'
Directory for Netplan Configuration Files
This is where the Netplan configuration files are stored:
netplan_configuration_dir: '/etc/netplan'
Name of the Netplan Configuration File
This is the name of the Netplan configuration file:
netplan_configuration_file: 'config.yaml'
Path to the Netplan Configuration File
This is the full path to the Netplan configuration file:
netplan_configuration_file_path: "{{ (netplan_configuration_dir, netplan_configuration_file) | path_join }}"
Packages to Install
This is the list of packages that need to be installed:
netplan_packages:
- 'netplan.io'
Network Configuration File for ifupdown Package
This is the network configuration file used if networking is managed by the ifupdown package:
ifupdown_ifstate_file: '/run/network/ifstate'
Troubleshooting
Uninstall ifupdown Package Manually
Before safely removing the ifupdown
package, make sure Netplan networking is properly configured.
If ifupdown
is removed too soon, the role may hang.
Thus, this role does not handle the removal of the ifupdown
package.
Limitations
Cannot Bootstrap Network Configurations
Please note that network configurations cannot be set up during role execution. Managed nodes need to have their networking already configured.
No Support for Changing the Connection IP
Keep in mind that this role does not support changing the IP addresses associated with Ansible connections.
If you change the connection IP, the role may hang when netplan apply
is executed because Ansible will lose its SSH connection.
Dependencies
None.
License
Author Information
ansible-galaxy install hifis.netplan