From 1f48dca6b081e65ee3c0d59de508b4844d837b69 Mon Sep 17 00:00:00 2001
From: richm
+
@@ -285,6 +291,14 @@ the options are only present on the system but not in the
below. However, the partial networking configuration can be achieved via
specifying the network state configuration in the
network_state variable.
See below
+The role requires external collections only for management of
+rpm-ostree nodes. Please run the following command to
+install them if you need to manage rpm-ostree nodes:
ansible-galaxy collection install -vv -r meta/collection-requirements.ymlThe network role is configured via variables starting
with network_ as the name prefix. List of variables:
Setting the variables
-network_provider: nm
-network_connections:
- - name: eth0
- #...
-network_allow_restart: truenetwork_provider: nm
-network_state:
- interfaces:
- - name: eth0
- #...
- routes:
- config:
- #...
- dns-resolver:
- config:
- #...network_provider: nm
+network_state:
+ interfaces:
+ - name: eth0
+ #...
+ routes:
+ config:
+ #...
+ dns-resolver:
+ config:
+ #...The network_connections variable is a list of
dictionaries that include the following options. List of options:
network_connections variable, add an
entry without a name and persistent_state: absent. This
will match and remove all remaining profiles:
-network_connections:
- - name: eth0 # profiles to keep/configure on the system
- [...]
-
- - persistent_state: absent # remove all other profilesnetwork_connections:
+ - name: eth0 # profiles to keep/configure on the system
+ [...]
+
+ - persistent_state: absent # remove all other profilesstateThe state option identifies what is the runtime state of
each connection profile. The state option (optional) can be
@@ -901,89 +915,89 @@ Mini ring.
ring.
-
ethtool:
- features:
- esp_hw_offload: true|false # optional
- esp_tx_csum_hw_offload: true|false # optional
- fcoe_mtu: true|false # optional
- gro: true|false # optional
- gso: true|false # optional
- highdma: true|false # optional
- hw_tc_offload: true|false # optional
- l2_fwd_offload: true|false # optional
- loopback: true|false # optional
- lro: true|false # optional
- ntuple: true|false # optional
- rx: true|false # optional
- rx_all: true|false # optional
- rx_fcs: true|false # optional
- rx_gro_hw: true|false # optional
- rx_udp_tunnel_port_offload: true|false # optional
- rx_vlan_filter: true|false # optional
- rx_vlan_stag_filter: true|false # optional
- rx_vlan_stag_hw_parse: true|false # optional
- rxhash: true|false # optional
- rxvlan: true|false # optional
- sg: true|false # optional
- tls_hw_record: true|false # optional
- tls_hw_tx_offload: true|false # optional
- tso: true|false # optional
- tx: true|false # optional
- tx_checksum_fcoe_crc: true|false # optional
- tx_checksum_ip_generic: true|false # optional
- tx_checksum_ipv4: true|false # optional
- tx_checksum_ipv6: true|false # optional
- tx_checksum_sctp: true|false # optional
- tx_esp_segmentation: true|false # optional
- tx_fcoe_segmentation: true|false # optional
- tx_gre_csum_segmentation: true|false # optional
- tx_gre_segmentation: true|false # optional
- tx_gso_partial: true|false # optional
- tx_gso_robust: true|false # optional
- tx_ipxip4_segmentation: true|false # optional
- tx_ipxip6_segmentation: true|false # optional
- tx_nocache_copy: true|false # optional
- tx_scatter_gather: true|false # optional
- tx_scatter_gather_fraglist: true|false # optional
- tx_sctp_segmentation: true|false # optional
- tx_tcp_ecn_segmentation: true|false # optional
- tx_tcp_mangleid_segmentation: true|false # optional
- tx_tcp_segmentation: true|false # optional
- tx_tcp6_segmentation: true|false # optional
- tx_udp_segmentation: true|false # optional
- tx_udp_tnl_csum_segmentation: true|false # optional
- tx_udp_tnl_segmentation: true|false # optional
- tx_vlan_stag_hw_insert: true|false # optional
- txvlan: true|false # optional
- coalesce:
- adaptive_rx: true|false # optional
- adaptive_tx: true|false # optional
- pkt_rate_high: 0 # optional mininum=0 maximum=0xffffffff
- pkt_rate_low: 0 # optional mininum=0 maximum=0xffffffff
- rx_frames: 0 # optional mininum=0 maximum=0xffffffff
- rx_frames_high: 0 # optional mininum=0 maximum=0xffffffff
- rx_frames_irq: 0 # optional mininum=0 maximum=0xffffffff
- rx_frames_low: 0 # optional mininum=0 maximum=0xffffffff
- rx_usecs: 0 # optional mininum=0 maximum=0xffffffff
- rx_usecs_high: 0 # optional mininum=0 maximum=0xffffffff
- rx_usecs_irq: 0 # optional mininum=0 maximum=0xffffffff
- rx_usecs_low: 0 # optional mininum=0 maximum=0xffffffff
- sample_interval: 0 # optional mininum=0 maximum=0xffffffff
- stats_block_usecs: 0 # optional mininum=0 maximum=0xffffffff
- tx_frames: 0 # optional mininum=0 maximum=0xffffffff
- tx_frames_high: 0 # optional mininum=0 maximum=0xffffffff
- tx_frames_irq: 0 # optional mininum=0 maximum=0xffffffff
- tx_frames_low: 0 # optional mininum=0 maximum=0xffffffff
- tx_usecs: 0 # optional mininum=0 maximum=0xffffffff
- tx_usecs_high: 0 # optional mininum=0 maximum=0xffffffff
- tx_usecs_irq: 0 # optional mininum=0 maximum=0xffffffff
- tx_usecs_low: 0 # optional mininum=0 maximum=0xffffffff
- ring:
- rx: 0 # optional mininum=0 maximum=0xffffffff
- rx_jumbo: 0 # optional mininum=0 maximum=0xffffffff
- rx_mini: 0 # optional mininum=0 maximum=0xffffffff
- tx: 0 # optional mininum=0 maximum=0xffffffff ethtool:
+ features:
+ esp_hw_offload: true|false # optional
+ esp_tx_csum_hw_offload: true|false # optional
+ fcoe_mtu: true|false # optional
+ gro: true|false # optional
+ gso: true|false # optional
+ highdma: true|false # optional
+ hw_tc_offload: true|false # optional
+ l2_fwd_offload: true|false # optional
+ loopback: true|false # optional
+ lro: true|false # optional
+ ntuple: true|false # optional
+ rx: true|false # optional
+ rx_all: true|false # optional
+ rx_fcs: true|false # optional
+ rx_gro_hw: true|false # optional
+ rx_udp_tunnel_port_offload: true|false # optional
+ rx_vlan_filter: true|false # optional
+ rx_vlan_stag_filter: true|false # optional
+ rx_vlan_stag_hw_parse: true|false # optional
+ rxhash: true|false # optional
+ rxvlan: true|false # optional
+ sg: true|false # optional
+ tls_hw_record: true|false # optional
+ tls_hw_tx_offload: true|false # optional
+ tso: true|false # optional
+ tx: true|false # optional
+ tx_checksum_fcoe_crc: true|false # optional
+ tx_checksum_ip_generic: true|false # optional
+ tx_checksum_ipv4: true|false # optional
+ tx_checksum_ipv6: true|false # optional
+ tx_checksum_sctp: true|false # optional
+ tx_esp_segmentation: true|false # optional
+ tx_fcoe_segmentation: true|false # optional
+ tx_gre_csum_segmentation: true|false # optional
+ tx_gre_segmentation: true|false # optional
+ tx_gso_partial: true|false # optional
+ tx_gso_robust: true|false # optional
+ tx_ipxip4_segmentation: true|false # optional
+ tx_ipxip6_segmentation: true|false # optional
+ tx_nocache_copy: true|false # optional
+ tx_scatter_gather: true|false # optional
+ tx_scatter_gather_fraglist: true|false # optional
+ tx_sctp_segmentation: true|false # optional
+ tx_tcp_ecn_segmentation: true|false # optional
+ tx_tcp_mangleid_segmentation: true|false # optional
+ tx_tcp_segmentation: true|false # optional
+ tx_tcp6_segmentation: true|false # optional
+ tx_udp_segmentation: true|false # optional
+ tx_udp_tnl_csum_segmentation: true|false # optional
+ tx_udp_tnl_segmentation: true|false # optional
+ tx_vlan_stag_hw_insert: true|false # optional
+ txvlan: true|false # optional
+ coalesce:
+ adaptive_rx: true|false # optional
+ adaptive_tx: true|false # optional
+ pkt_rate_high: 0 # optional mininum=0 maximum=0xffffffff
+ pkt_rate_low: 0 # optional mininum=0 maximum=0xffffffff
+ rx_frames: 0 # optional mininum=0 maximum=0xffffffff
+ rx_frames_high: 0 # optional mininum=0 maximum=0xffffffff
+ rx_frames_irq: 0 # optional mininum=0 maximum=0xffffffff
+ rx_frames_low: 0 # optional mininum=0 maximum=0xffffffff
+ rx_usecs: 0 # optional mininum=0 maximum=0xffffffff
+ rx_usecs_high: 0 # optional mininum=0 maximum=0xffffffff
+ rx_usecs_irq: 0 # optional mininum=0 maximum=0xffffffff
+ rx_usecs_low: 0 # optional mininum=0 maximum=0xffffffff
+ sample_interval: 0 # optional mininum=0 maximum=0xffffffff
+ stats_block_usecs: 0 # optional mininum=0 maximum=0xffffffff
+ tx_frames: 0 # optional mininum=0 maximum=0xffffffff
+ tx_frames_high: 0 # optional mininum=0 maximum=0xffffffff
+ tx_frames_irq: 0 # optional mininum=0 maximum=0xffffffff
+ tx_frames_low: 0 # optional mininum=0 maximum=0xffffffff
+ tx_usecs: 0 # optional mininum=0 maximum=0xffffffff
+ tx_usecs_high: 0 # optional mininum=0 maximum=0xffffffff
+ tx_usecs_irq: 0 # optional mininum=0 maximum=0xffffffff
+ tx_usecs_low: 0 # optional mininum=0 maximum=0xffffffff
+ ring:
+ rx: 0 # optional mininum=0 maximum=0xffffffff
+ rx_jumbo: 0 # optional mininum=0 maximum=0xffffffff
+ rx_mini: 0 # optional mininum=0 maximum=0xffffffff
+ tx: 0 # optional mininum=0 maximum=0xffffffffieee802_1xConfigures 802.1x authentication for an interface.
Currently, NetworkManager is the only supported provider and EAP-TLS
@@ -1148,294 +1162,294 @@ selection, the possible values are: layer2,
Setting the same connection profile multiple times:
-network_connections:
- - name: Wired0
- type: ethernet
- interface_name: eth0
- ip:
- dhcp4: true
-
- - name: Wired0
- state: upActivating a preexisting connection profile:
network_connections:
- - name: eth0
- state: upDeactivating a preexisting connection profile:
+ - name: Wired0 + type: ethernet + interface_name: eth0 + ip: + dhcp4: true + + - name: Wired0 + state: up +Activating a preexisting connection profile:
network_connections:
- name: eth0
- state: downCreating a persistent connection profile:
+ state: up +Deactivating a preexisting connection profile:
network_connections:
- name: eth0
- #persistent_state: present # default
- type: ethernet
- autoconnect: true
- mac: "00:00:5e:00:53:5d"
- ip:
- dhcp4: trueSpecifying a connecting profile for an ethernet device with the
-ID_PATH:
Creating a persistent connection profile:
network_connections:
- name: eth0
- type: ethernet
- # For PCI devices, the path has the form "pci-$domain:$bus:$device.$function"
- # The profile will only match the interface at the PCI address pci-0000:00:03.0
- match:
- path:
- - pci-0000:00:03.0
- ip:
- address:
- - 192.0.2.3/24Specifying a connecting profile for an ethernet device with the
+ID_PATH:
- name: eth0
- type: ethernet
- # Specifying a connecting profile for an ethernet device only with the PCI address
- # pci-0000:00:01.0 or pci-0000:00:03.0
- match:
- path:
- - pci-0000:00:0[1-3].0
- - &!pci-0000:00:02.0
+class="sourceCode yaml">network_connections:
+ - name: eth0
+ type: ethernet
+ # For PCI devices, the path has the form "pci-$domain:$bus:$device.$function"
+ # The profile will only match the interface at the PCI address pci-0000:00:03.0
+ match:
+ path:
+ - pci-0000:00:03.0
ip:
address:
- 192.0.2.3/24 - name: eth0
+ type: ethernet
+ # Specifying a connecting profile for an ethernet device only with the PCI address
+ # pci-0000:00:01.0 or pci-0000:00:03.0
+ match:
+ path:
+ - pci-0000:00:0[1-3].0
+ - &!pci-0000:00:02.0
+ ip:
+ address:
+ - 192.0.2.3/24Deleting a connection profile named eth0 (if it
exists):
network_connections:
- - name: eth0
- persistent_state: absentConfiguring the Ethernet link settings:
network_connections:
- name: eth0
- type: ethernet
-
- ethernet:
- autoneg: false
- speed: 1000
- duplex: fullCreating a bridge connection:
+ persistent_state: absent +Configuring the Ethernet link settings:
network_connections:
- - name: br0
- type: bridge
- #interface_name: br0 # defaults to the connection nameConfiguring a bridge connection:
+ - name: eth0 + type: ethernet + + ethernet: + autoneg: false + speed: 1000 + duplex: full +Creating a bridge connection:
network_connections:
- - name: internal-br0
- interface_name: br0
- type: bridge
- ip:
- dhcp4: false
- auto6: falseSetting controller and port_type:
Configuring a bridge connection:
network_connections:
- - name: br0-bond0
- type: bond
- interface_name: bond0
- controller: internal-br0
- port_type: bridge
-
- - name: br0-bond0-eth1
- type: ethernet
- interface_name: eth1
- controller: br0-bond0
- port_type: bondConfiguring VLANs:
+ - name: internal-br0 + interface_name: br0 + type: bridge + ip: + dhcp4: false + auto6: false +Setting controller and port_type:
network_connections:
- - name: eth1-profile
- autoconnect: false
- type: ethernet
- interface_name: eth1
- ip:
- dhcp4: false
- auto6: false
-
- - name: eth1.6
- autoconnect: false
- type: vlan
- parent: eth1-profile
- vlan:
- id: 6
- ip:
- address:
- - 192.0.2.5/24
- auto6: falseConfiguring MACVLAN:
+ - name: br0-bond0 + type: bond + interface_name: bond0 + controller: internal-br0 + port_type: bridge + + - name: br0-bond0-eth1 + type: ethernet + interface_name: eth1 + controller: br0-bond0 + port_type: bond +Configuring VLANs:
network_connections:
- - name: eth0-profile
- type: ethernet
- interface_name: eth0
- ip:
- address:
- - 192.168.0.1/24
-
- - name: veth0
- type: macvlan
- parent: eth0-profile
- macvlan:
- mode: bridge
- promiscuous: true
- tap: false
+ - name: eth1-profile
+ autoconnect: false
+ type: ethernet
+ interface_name: eth1
+ ip:
+ dhcp4: false
+ auto6: false
+
+ - name: eth1.6
+ autoconnect: false
+ type: vlan
+ parent: eth1-profile
+ vlan:
+ id: 6
ip:
address:
- - 192.168.1.1/24Configuring a wireless connection:
+ - 192.0.2.5/24 + auto6: false +Configuring MACVLAN:
network_connections:
- - name: wlan0
- type: wireless
- wireless:
- ssid: "My WPA2-PSK Network"
- key_mgmt: "wpa-psk"
- # recommend vault encrypting the wireless password
- # see https://docs.ansible.com/ansible/latest/user_guide/vault.html
- password: "p@55w0rD"Setting the IP configuration:
+ - name: eth0-profile + type: ethernet + interface_name: eth0 + ip: + address: + - 192.168.0.1/24 + + - name: veth0 + type: macvlan + parent: eth0-profile + macvlan: + mode: bridge + promiscuous: true + tap: false + ip: + address: + - 192.168.1.1/24 +Configuring a wireless connection:
network_connections:
- - name: eth0
- type: ethernet
- ip:
- route_metric4: 100
- dhcp4: false
- #dhcp4_send_hostname: false
- gateway4: 192.0.2.1
-
- dns:
- - 192.0.2.2
- - 198.51.100.5
- dns_search:
- - example.com
- - subdomain.example.com
- dns_options:
- - rotate
- - timeout:1
-
- route_metric6: -1
- auto6: false
- gateway6: 2001:db8::1
-
- address:
- - 192.0.2.3/24
- - 198.51.100.3/26
- - 2001:db8::80/7
-
- route:
- - network: 198.51.100.128
- prefix: 26
- gateway: 198.51.100.1
- metric: 2
- - network: 198.51.100.64
- prefix: 26
- gateway: 198.51.100.6
- metric: 4
- route_append_only: false
- rule_append_only: trueConfiguring 802.1x:
+ - name: wlan0 + type: wireless + wireless: + ssid: "My WPA2-PSK Network" + key_mgmt: "wpa-psk" + # recommend vault encrypting the wireless password + # see https://docs.ansible.com/ansible/latest/user_guide/vault.html + password: "p@55w0rD" +Setting the IP configuration:
network_connections:
- name: eth0
type: ethernet
- ieee802_1x:
- identity: myhost
- eap: tls
- private_key: /etc/pki/tls/client.key
- # recommend vault encrypting the private key password
- # see https://docs.ansible.com/ansible/latest/user_guide/vault.html
- private_key_password: "p@55w0rD"
- client_cert: /etc/pki/tls/client.pem
- ca_cert: /etc/pki/tls/cacert.pem
- domain_suffix_match: example.comConfiguring Enhanced Open(OWE):
+ ip: + route_metric4: 100 + dhcp4: false + #dhcp4_send_hostname: false + gateway4: 192.0.2.1 + + dns: + - 192.0.2.2 + - 198.51.100.5 + dns_search: + - example.com + - subdomain.example.com + dns_options: + - rotate + - timeout:1 + + route_metric6: -1 + auto6: false + gateway6: 2001:db8::1 + + address: + - 192.0.2.3/24 + - 198.51.100.3/26 + - 2001:db8::80/7 + + route: + - network: 198.51.100.128 + prefix: 26 + gateway: 198.51.100.1 + metric: 2 + - network: 198.51.100.64 + prefix: 26 + gateway: 198.51.100.6 + metric: 4 + route_append_only: false + rule_append_only: true +Configuring 802.1x:
network_connections:
- - name: wlan0
- type: wireless
- wireless:
- ssid: "WIFI_SSID"
- key_mgmt: "owe"Configuring Enhanced Open(OWE):
+network_connections:
+ - name: wlan0
+ type: wireless
+ wireless:
+ ssid: "WIFI_SSID"
+ key_mgmt: "owe"Configuring the IP addresses:
-network_state:
- interfaces:
- - name: ethtest0
- type: ethernet
- state: up
- ipv4:
- enabled: true
- address:
- - ip: 192.168.122.250
- prefix-length: 24
- dhcp: false
- ipv6:
- enabled: true
- address:
- - ip: 2001:db8::1:1
- prefix-length: 64
- autoconf: false
- dhcp: false
- - name: ethtest1
- type: ethernet
- state: up
- ipv4:
- enabled: true
- address:
- - ip: 192.168.100.192
- prefix-length: 24
- auto-dns: false
- dhcp: false
- ipv6:
- enabled: true
- address:
- - ip: 2001:db8::2:1
- prefix-length: 64
- autoconf: false
- dhcp: falseConfiguring the route:
network_state:
interfaces:
- - name: eth1
+ - name: ethtest0
type: ethernet
state: up
ipv4:
enabled: true
address:
- - ip: 192.0.2.251
+ - ip: 192.168.122.250
prefix-length: 24
dhcp: false
-
- routes:
- config:
- - destination: 198.51.100.0/24
- metric: 150
- next-hop-address: 192.0.2.251
- next-hop-interface: eth1
- table-id: 254Configuring the DNS search and server:
+ ipv6: + enabled: true + address: + - ip: 2001:db8::1:1 + prefix-length: 64 + autoconf: false + dhcp: false + - name: ethtest1 + type: ethernet + state: up + ipv4: + enabled: true + address: + - ip: 192.168.100.192 + prefix-length: 24 + auto-dns: false + dhcp: false + ipv6: + enabled: true + address: + - ip: 2001:db8::2:1 + prefix-length: 64 + autoconf: false + dhcp: false +Configuring the route:
network_state:
- dns-resolver:
- config:
- search:
- - example.com
- - example.org
- server:
- - 2001:4860:4860::8888
- - 8.8.8.8Configuring the DNS search and server:
+network_state:
+ dns-resolver:
+ config:
+ search:
+ - example.com
+ - example.org
+ server:
+ - 2001:4860:4860::8888
+ - 8.8.8.8The network role rejects invalid configurations. It is
@@ -1525,6 +1539,8 @@ result in a working configuration.
Want to contribute? Take a look at our contributing guidelines!
+See README-ostree.md