diff --git a/README.md b/README.md index 2250254..bd50ed5 100644 --- a/README.md +++ b/README.md @@ -14,368 +14,296 @@ Role Variables -------------- ``` -ENTRY POINT: main - Configure networking interfaces with ifupdown or netplan +ENTRY POINT: *main* - Configure networking interfaces with ifupdown or netplan - Configure and apply networking interface configuration - (including VLANs, and WiFi) with either ifupdown or netplan - depending on which is installed on the host system. + Configure and apply networking interface configuration + (including VLANs, and WiFi) with either ifupdown or netplan + depending on which is installed on the host system. -OPTIONS (= is mandatory): +Options (= indicates it is required): -- netplan_renderer - Networking backend to use for netplan - choices: [networkd, NetworkManager] - default: networkd - type: str +- netplan_renderer Networking backend to use for netplan + choices: [networkd, NetworkManager] + default: networkd + type: str -- network_dad_attempts - Number of attempts to settle DAD (0 to disable DAD) - default: 100 - type: int +- network_dad_attempts Number of attempts to settle DAD (0 to disable DAD) + default: 100 + type: int -- network_hooks - List of network hook scripts to run when interfaces change - state - default: null - elements: dict - type: list +- network_hooks List of network hook scripts to run when interfaces change state + default: null + elements: dict + type: list + options: - OPTIONS: - - = hook - Contents of network hook script + = hook Contents of network hook script type: str - = name - Name of network hook + = name Name of network hook type: str - = phase - Interface phase to run hook script + = phase Interface phase to run hook script choices: [pre-up, up, down, post-down] type: str -- network_ifupdown_config - Contents of the /etc/default/networking configuration file, or - empty string to leave file as is - default: '' - type: str - -- network_interfaces - List of network interfaces to configure - default: null - elements: dict - type: list +- network_ifupdown_config Contents of the /etc/default/networking configuration file, or empty + string to leave file as is + default: '' + type: str - OPTIONS: +- network_interfaces List of network interfaces to configure + default: null + elements: dict + type: list + options: - - access_points - List of wireless networks to configure + - access_points List of wireless networks to configure default: null elements: dict type: list - - OPTIONS: - - - identity - The identity to use for EAP - default: null - type: str - - - key-management - Key management mode - choices: [none, psk, eap] - default: psk - type: str - - - method - The EAP method to use - choices: [tls, peap, ttls] - default: null - type: str - - - password - The password string for EAP, or the pre-shared key for - WPA-PSK - default: null - no_log: true - type: str - - - phase2-auth - The phase 2 auth mechanism - default: null - type: str - - - ssid - SSID - default: null - type: str - - - allow - Subsystem the interface should be brought up by (ifupdown - only) + options: + + - identity The identity to use for EAP + default: null + type: str + + - key-management Key management mode + choices: [none, psk, eap] + default: psk + type: str + + - method The EAP method to use + choices: [tls, peap, ttls] + default: null + type: str + + - password The password string for EAP, or the pre-shared key for + WPA-PSK + default: null + no_log: true + type: str + + - phase2-auth The phase 2 auth mechanism + default: null + type: str + + - ssid SSID + default: null + type: str + + - allow Subsystem the interface should be brought up by (ifupdown + only) default: null type: str - - bridge_ports - Interfaces to add to bridge + - bridge_ports Interfaces to add to bridge default: null elements: str type: list - - bridge_waitport - Time in seconds to wait for bridge ports to come up + - bridge_waitport Time in seconds to wait for bridge ports to come up default: null type: int - - dns_nameservers - List of DNS resolver IP addresses + - dns_nameservers List of DNS resolver IP addresses default: null elements: str type: list - - dns_search - List of DNS search domains + - dns_search List of DNS search domains default: null elements: str type: list - - families - List of IP address families to configure + - families List of IP address families to configure default: null elements: dict type: list + options: - OPTIONS: + - address Static IP address for interface + default: null + type: str - - address - Static IP address for interface - default: null - type: str + - gateway Default gateway + default: null + type: str - - gateway - Default gateway - default: null - type: str - - = name - IP address family - choices: [ipv4, ipv6] - type: str + = name IP address family + choices: [ipv4, ipv6] + type: str - = type - IP address autoconfiguration source - choices: [static, dhcp, auto, manual] - type: str + = type IP address autoconfiguration source + choices: [static, dhcp, auto, manual] + type: str - - match_mac - Apply configuration by matching MAC address instead of - interface name (netplan only) + - match_mac Apply configuration by matching MAC address instead of + interface name (netplan only) default: null type: str - - mtu - Interface MTU + - mtu Interface MTU default: null type: int - = name - Interface name + = name Interface name type: str - - vlans - List of VLAN interfaces to configure + - vlans List of VLAN interfaces to configure default: null elements: dict type: list + options: - OPTIONS: + - access_points List of wireless networks to configure + default: null + elements: dict + type: list + options: - - access_points - List of wireless networks to configure + - identity The identity to use for EAP default: null - elements: dict - type: list - - OPTIONS: - - - identity - The identity to use for EAP - default: null - type: str - - - key-management - Key management mode - choices: [none, psk, eap] - default: psk - type: str - - - method - The EAP method to use - choices: [tls, peap, ttls] - default: null - type: str - - - password - The password string for EAP, or the pre-shared key - for WPA-PSK - default: null - no_log: true - type: str - - - phase2-auth - The phase 2 auth mechanism - default: null - type: str - - - ssid - SSID - default: null - type: str - - - allow - Subsystem the interface should be brought up by - (ifupdown only) + type: str + + - key-management Key management mode + choices: [none, psk, eap] + default: psk + type: str + + - method The EAP method to use + choices: [tls, peap, ttls] default: null type: str - - bridge_ports - Interfaces to add to bridge + - password The password string for EAP, or the pre-shared key for + WPA-PSK default: null - elements: str - type: list + no_log: true + type: str - - bridge_waitport - Time in seconds to wait for bridge ports to come up + - phase2-auth The phase 2 auth mechanism default: null - type: int + type: str - - dns_nameservers - List of DNS resolver IP addresses + - ssid SSID default: null - elements: str - type: list + type: str - - dns_search - List of DNS search domains + - allow Subsystem the interface should be brought up by + (ifupdown only) + default: null + type: str + + - bridge_ports Interfaces to add to bridge + default: null + elements: str + type: list + + - bridge_waitport Time in seconds to wait for bridge ports to come up + default: null + type: int + + - dns_nameservers List of DNS resolver IP addresses + default: null + elements: str + type: list + + - dns_search List of DNS search domains + default: null + elements: str + type: list + + - families List of IP address families to configure + default: null + elements: dict + type: list + options: + + - address Static IP address for interface default: null - elements: str - type: list + type: str - - families - List of IP address families to configure + - gateway Default gateway default: null - elements: dict - type: list + type: str - OPTIONS: + = name IP address family + choices: [ipv4, ipv6] + type: str + + = type IP address autoconfiguration source + choices: [static, dhcp, auto, manual] + type: str - - address - Static IP address for interface - default: null - type: str + = id VLAN ID + type: int - - gateway - Default gateway - default: null - type: str + - mtu Interface MTU + default: null + type: int - = name - IP address family - choices: [ipv4, ipv6] - type: str + = waitonboot If true, wait for interface to come up before booting + type: bool - = type - IP address autoconfiguration source - choices: [static, dhcp, auto, manual] - type: str + = waitonboot If true, wait for interface to come up before booting + type: bool - = id - VLAN ID - type: int +- network_kernel_options_config_file Path for the file containing networking kernel modules options + default: /etc/modprobe.d/zz-ansible-network-options.conf + type: str - - mtu - Interface MTU - default: null - type: int +- network_systemd_wait_online If true, enable appropriate network wait-online systemd service + default: false + type: bool - = waitonboot - If true, wait for interface to come up before booting - type: bool +- network_tune If true, enable network tuning + default: false + type: bool - = waitonboot - If true, wait for interface to come up before booting - type: bool +- network_tune_interface Override the automatic detection of which network interface to use + for setting tuning values + default: null + type: str -- network_kernel_options_config_file - Path for the file containing networking kernel modules options - default: /etc/modprobe.d/zz-ansible-network-options.conf - type: str - -- network_systemd_wait_online - If true, enable appropriate network wait-online systemd - service - default: false - type: bool - -- network_tune - If true, enable network tuning - default: false - type: bool - -- network_tune_interface - Override the automatic detection of which network interface to - use for setting tuning values - default: null - type: str - -- network_tune_sysctls - List of sysctls that should be applied for different interface - speeds - default: null - elements: dict - type: list - - OPTIONS: - - = min_speed - Minimum network interface speed (in megabits per second) - for which these sysctls should apply +- network_tune_sysctls List of sysctls that should be applied for different interface + speeds + default: null + elements: dict + type: list + options: + + = min_speed Minimum network interface speed (in megabits per second) + for which these sysctls should apply type: int - = sysctls - List of sysctls to set + = sysctls List of sysctls to set elements: dict type: list - - OPTIONS: - - = key - Name of sysctl - type: str - - = value - Value of sysctl - type: str - -- network_wait_on_change - If true, wait for user to accept any network configuration - changes before continuing and applying the changes - default: true - type: bool - -- wireless_packages - List of packages to install when there are wireless network - devices present - default: [iw, wpasupplicant] - elements: str - type: list - -- wireless_regulatory_country - ISO/IEC 3166-1 alpha2 country code to use for wireless - regulatory domain, or empty string to not configure - default: '' - type: str + options: + + = key Name of sysctl + type: str + + = value Value of sysctl + type: str + +- network_wait_on_change If true, wait for user to accept any network configuration changes + before continuing and applying the changes + default: true + type: bool + +- wireless_packages List of packages to install when there are wireless network devices + present + default: [iw, wpasupplicant] + elements: str + type: list + +- wireless_regulatory_country ISO/IEC 3166-1 alpha2 country code to use for wireless regulatory + domain, or empty string to not + configure + default: '' + type: str ``` Installation diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 87e33ab..f179dab 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -22,6 +22,12 @@ - "netplan.io" when: ansible_distribution == "Ubuntu" + - name: "Start udev" + ansible.builtin.systemd: + name: "udev.service" + state: "started" + when: ansible_distribution == "Ubuntu" + - name: "Add virtual network interface" ansible.builtin.command: "ip tuntap add eno1 mode tap" args: