Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

⚠️ PLEASE NOTE: This role has been migrated to our hifis.toolkit collection. ⚠️ This role installs Netplan and configures networking on hosts.

License

Notifications You must be signed in to change notification settings

hifis-net/ansible-role-netplan

Repository files navigation

Netplan Role

⚠️ This project is archived! ⚠️

This role has been migrated to our hifis.toolkit collection:

CI Status Ansible Role: hifis.netplan Ansible Role Downloads Apache-2.0 Licensed Latest release

Ansible role to install and configure Netplan.

Requirements

None.

Role Variables

Mandatory Variables to be Set that are Not Set with Defaults

Sample Network Configuration

Sample 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 that are Set with Defaults

Flag to delete any pre-existing Netplan configuration files

Flag decides on whether pre-existing Netplan configuration files should be deleted:

netplan_remove_existing_configs: true

Name of the Netplan Configuration File Template

Name of the template providing the Netplan configuration file:

netplan_configuration_file_template: 'config.yaml.j2'

Directory of the Netplan Configuration Files

Directory of the Netplan configuration files:

netplan_configuration_dir: '/etc/netplan'

Name of the Netplan Configuration File

Name of the Netplan configuration file:

netplan_configuration_file: 'config.yaml'

Path to the Netplan Configuration File

Path to the Netplan configuration file:

netplan_configuration_file_path: "{{ (netplan_configuration_dir, netplan_configuration_file) | path_join }}"

Packages to be Installed

List of packages that need to be installed:

netplan_packages:
  - 'netplan.io'

Package ifupdown Network Configuration File

Network configuration file that is present if networking is managed by package ifupdown:

ifupdown_ifstate_file: '/run/network/ifstate'

Troubleshooting

Cleaning Up: Please Uninstall Package ifupdown Manually

Before the package ifupdown can be safely removed netplan networking needs to be properly configured. If the package is removed too early, the role will hang.

For that reason this role does not handle the removal of the ifupdown package.

Limitations

Bootstrapping Network Configurations is not Supported

Please note that networking configurations can not be bootstrapped during role execution. The respective managed nodes need networking to be configured beforehand.

No support for changing the IP over which Ansible connects

Be aware that this role does not support changing the IP addresses over which Ansible connects out of the box. If you change the IP address over which Ansible connects, you might end up in a hanging role as soon as netplan apply is executed. Ansible loses its SSH connection in that case.

Dependencies

None.

License

Apache-2.0

Author Information

HIFIS Software Team

About

⚠️ PLEASE NOTE: This role has been migrated to our hifis.toolkit collection. ⚠️ This role installs Netplan and configures networking on hosts.

Topics

Resources

License

Stars

Watchers

Forks

Languages