support ansible-core-2.14, ansible-lint 6.x

ansible-core 2.14 is now the current version of Ansible.  This version
does not support `args: warn: false` so we have to remove it from the
network role.  Users will need to use `COMMAND_WARNINGS` in their
Ansible configuration in order to suppress the warning in older versions
of Ansible such as 2.9, 2.11.
In addition, the gating tests are getting stricter about using new best
practices, such as using `true`, `false` for booleans instead of `yes`,
`no`; use of spaces in Jinja expressions; etc.  These issues were
addressed.
The `tests/` directory contains far too many cases of non-recommended
practices, so this directory has been exempted.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
Rich Megginson 2022-11-10 15:42:20 -07:00 committed by Richard Megginson
parent 2e43d027f1
commit cf356230ca
43 changed files with 355 additions and 224 deletions

View file

@ -1,8 +1,10 @@
---
exclude_paths:
- tests/
- .github/
- .ansible-lint
skip_list:
- '106' # Role name does not match ^[a-z][a-z0-9_]+$ pattern
- '303' # Using command rather than module
- '403' # Package installs should not use latest
- var-naming # allow tests to use var names with Capital Letters
- role-name
- fqcn
warn_list:
- load-failure # allow include_tasks with tasks/ directory
- load-failure # allow include_tasks with tasks/ directory

View file

@ -6,6 +6,7 @@ plugins/module_utils/network_lsr/nm/__init__.py import-3.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.8!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.9!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.10!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.5!skip
@ -13,6 +14,7 @@ plugins/module_utils/network_lsr/nm/active_connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/client.py import-2.6!skip
plugins/module_utils/network_lsr/nm/client.py import-2.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.5!skip
@ -20,6 +22,7 @@ plugins/module_utils/network_lsr/nm/client.py import-3.6!skip
plugins/module_utils/network_lsr/nm/client.py import-3.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.8!skip
plugins/module_utils/network_lsr/nm/client.py import-3.9!skip
plugins/module_utils/network_lsr/nm/client.py import-3.10!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.5!skip
@ -27,6 +30,7 @@ plugins/module_utils/network_lsr/nm/connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/error.py import-2.6!skip
plugins/module_utils/network_lsr/nm/error.py import-2.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.5!skip
@ -34,6 +38,7 @@ plugins/module_utils/network_lsr/nm/error.py import-3.6!skip
plugins/module_utils/network_lsr/nm/error.py import-3.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.8!skip
plugins/module_utils/network_lsr/nm/error.py import-3.9!skip
plugins/module_utils/network_lsr/nm/error.py import-3.10!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.5!skip
@ -41,6 +46,7 @@ plugins/module_utils/network_lsr/nm/provider.py import-3.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.8!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.9!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.10!skip
plugins/modules/network_connections.py validate-modules:doc-default-does-not-match-spec
plugins/modules/network_connections.py validate-modules:doc-required-mismatch
plugins/modules/network_connections.py validate-modules:missing-examples

View file

@ -0,0 +1,77 @@
plugins/module_utils/network_lsr/nm/__init__.py empty-init!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.5!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.8!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.9!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.10!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/client.py import-2.6!skip
plugins/module_utils/network_lsr/nm/client.py import-2.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.5!skip
plugins/module_utils/network_lsr/nm/client.py import-3.6!skip
plugins/module_utils/network_lsr/nm/client.py import-3.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.8!skip
plugins/module_utils/network_lsr/nm/client.py import-3.9!skip
plugins/module_utils/network_lsr/nm/client.py import-3.10!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/error.py import-2.6!skip
plugins/module_utils/network_lsr/nm/error.py import-2.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.5!skip
plugins/module_utils/network_lsr/nm/error.py import-3.6!skip
plugins/module_utils/network_lsr/nm/error.py import-3.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.8!skip
plugins/module_utils/network_lsr/nm/error.py import-3.9!skip
plugins/module_utils/network_lsr/nm/error.py import-3.10!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.5!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.8!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.9!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.10!skip
plugins/modules/network_connections.py validate-modules:doc-default-does-not-match-spec
plugins/modules/network_connections.py validate-modules:doc-required-mismatch
plugins/modules/network_connections.py validate-modules:missing-examples
plugins/modules/network_connections.py validate-modules:missing-gplv3-license
plugins/modules/network_connections.py validate-modules:module-invalid-version-added
plugins/modules/network_connections.py validate-modules:no-default-for-required-parameter
plugins/modules/network_connections.py validate-modules:parameter-list-no-elements
plugins/modules/network_connections.py validate-modules:parameter-type-not-in-doc
plugins/modules/network_connections.py validate-modules:undocumented-parameter
plugins/modules/network_state.py import-2.6!skip
plugins/modules/network_state.py import-2.7!skip
plugins/modules/network_state.py import-3.5!skip
plugins/modules/network_state.py import-3.6!skip
plugins/modules/network_state.py import-3.7!skip
plugins/modules/network_state.py import-3.8!skip
plugins/modules/network_state.py import-3.9!skip
plugins/modules/network_state.py import-3.10!skip
plugins/modules/network_state.py validate-modules:import-error
plugins/modules/network_state.py validate-modules:missing-examples
plugins/modules/network_state.py validate-modules:missing-gplv3-license
plugins/modules/network_state.py validate-modules:module-invalid-version-added
tests/network/covstats shebang!skip
tests/network/ensure_provider_tests.py shebang!skip
tests/network/get_coverage.sh shebang!skip
tests/network/get_total_coverage.sh shebang!skip
tests/network/git-pre-commit.sh shebang!skip
tests/network/git-post-commit.sh shebang!skip
tests/network/merge_coverage.sh shebang!skip

View file

@ -0,0 +1,77 @@
plugins/module_utils/network_lsr/nm/__init__.py empty-init!skip
plugins/module_utils/network_lsr/nm/__init__.py import-2.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.5!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.6!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.7!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.8!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.9!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.10!skip
plugins/module_utils/network_lsr/nm/__init__.py import-3.11!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/active_connection.py import-3.11!skip
plugins/module_utils/network_lsr/nm/client.py import-2.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.5!skip
plugins/module_utils/network_lsr/nm/client.py import-3.6!skip
plugins/module_utils/network_lsr/nm/client.py import-3.7!skip
plugins/module_utils/network_lsr/nm/client.py import-3.8!skip
plugins/module_utils/network_lsr/nm/client.py import-3.9!skip
plugins/module_utils/network_lsr/nm/client.py import-3.10!skip
plugins/module_utils/network_lsr/nm/client.py import-3.11!skip
plugins/module_utils/network_lsr/nm/connection.py import-2.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.5!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.6!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.7!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.8!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.9!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.10!skip
plugins/module_utils/network_lsr/nm/connection.py import-3.11!skip
plugins/module_utils/network_lsr/nm/error.py import-2.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.5!skip
plugins/module_utils/network_lsr/nm/error.py import-3.6!skip
plugins/module_utils/network_lsr/nm/error.py import-3.7!skip
plugins/module_utils/network_lsr/nm/error.py import-3.8!skip
plugins/module_utils/network_lsr/nm/error.py import-3.9!skip
plugins/module_utils/network_lsr/nm/error.py import-3.10!skip
plugins/module_utils/network_lsr/nm/error.py import-3.11!skip
plugins/module_utils/network_lsr/nm/provider.py import-2.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.5!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.6!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.7!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.8!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.9!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.10!skip
plugins/module_utils/network_lsr/nm/provider.py import-3.11!skip
plugins/modules/network_connections.py validate-modules:doc-default-does-not-match-spec
plugins/modules/network_connections.py validate-modules:doc-required-mismatch
plugins/modules/network_connections.py validate-modules:missing-examples
plugins/modules/network_connections.py validate-modules:missing-gplv3-license
plugins/modules/network_connections.py validate-modules:module-invalid-version-added
plugins/modules/network_connections.py validate-modules:no-default-for-required-parameter
plugins/modules/network_connections.py validate-modules:parameter-list-no-elements
plugins/modules/network_connections.py validate-modules:parameter-type-not-in-doc
plugins/modules/network_connections.py validate-modules:undocumented-parameter
plugins/modules/network_state.py import-2.7!skip
plugins/modules/network_state.py import-3.5!skip
plugins/modules/network_state.py import-3.6!skip
plugins/modules/network_state.py import-3.7!skip
plugins/modules/network_state.py import-3.8!skip
plugins/modules/network_state.py import-3.9!skip
plugins/modules/network_state.py import-3.10!skip
plugins/modules/network_state.py import-3.11!skip
plugins/modules/network_state.py validate-modules:import-error
plugins/modules/network_state.py validate-modules:missing-examples
plugins/modules/network_state.py validate-modules:missing-gplv3-license
plugins/modules/network_state.py validate-modules:module-invalid-version-added
tests/network/covstats shebang!skip
tests/network/ensure_provider_tests.py shebang!skip
tests/network/get_coverage.sh shebang!skip
tests/network/get_total_coverage.sh shebang!skip
tests/network/git-pre-commit.sh shebang!skip
tests/network/git-post-commit.sh shebang!skip
tests/network/merge_coverage.sh shebang!skip

View file

@ -15,6 +15,9 @@ extends: yamllint_defaults.yml
# have to copy all of the rules from the base config
# rules:
# line-length: disable
ignore: |
tests/roles/
.tox/
rules:
truthy: disable
line-length:

174
README.md
View file

@ -82,7 +82,7 @@ the name prefix. List of variables:
- `network_allow_restart` - Certain configurations require the role to restart
network services. For example, if a wireless connection is configured and
NetworkManager-wifi is not installed, NetworkManager must be restarted prior
to the connection being configured. Setting this to `no` will prevent the
to the connection being configured. Setting this to `false` will prevent the
role from restarting network service.
- `network_state` - The network state settings can be configured in the managed
host, and the format and the syntax of the configuration should be consistent
@ -98,7 +98,7 @@ network_provider: nm
network_connections:
- name: eth0
#...
network_allow_restart: yes
network_allow_restart: true
```
```yaml
@ -255,12 +255,12 @@ If the type is `ethernet`, then there can be an extra `ethernet` dictionary with
items (options): `autoneg`, `speed` and `duplex`, which correspond to the
settings of the `ethtool` utility with the same name.
- `autoneg`: `yes` (default) or `no` [if auto-negotiation is enabled or disabled]
- `autoneg`: `true` (default) or `false` [if auto-negotiation is enabled or disabled]
- `speed`: speed in Mbit/s
- `duplex`: `half` or `full`
Note that the `speed` and `duplex` link settings are required when autonegotiation is
disabled (`autoneg: no`).
disabled (`autoneg: false`).
#### `type: bridge`, `type: bond`, `type: team`
@ -454,7 +454,7 @@ The IP configuration supports the following options:
If this variable is not specified, the role will use the default behavior of the
`network_provider` selected.
Setting this option to `no` is equivalent to:
Setting this option to `false` is equivalent to:
- `DEFROUTE = no` in initscripts, or
- `ipv4.never-default/ipv6.never-default yes` in nmcli
@ -578,7 +578,7 @@ The IP configuration supports the following options:
Select the incoming interface name to match.
- `invert` -
Invert the selected match of the rule. The possible values are boolean values
`True` and `False` (default). If the value is `True`, this is equivalent to match
`true` and `false` (default). If the value is `true`, this is equivalent to match
any packet that not satisfying selected match of the rule.
- `ipproto` -
Select the IP protocol value to match, the valid value ranges from 1 to 255.
@ -609,9 +609,9 @@ The IP configuration supports the following options:
The `route_append_only` option allows only to add new routes to the
existing routes on the system.
If the `route_append_only` boolean option is set to `yes`, the specified routes are
appended to the existing routes. If `route_append_only` is set to `no` (default),
the current routes are replaced. Note that setting `route_append_only` to `yes`
If the `route_append_only` boolean option is set to `true`, the specified routes are
appended to the existing routes. If `route_append_only` is set to `false` (default),
the current routes are replaced. Note that setting `route_append_only` to `true`
without setting `route` has the effect of preserving the current static routes.
- `rule_append_only`
@ -644,61 +644,61 @@ The ethtool configuration supports the following options:
```yaml
ethtool:
features:
esp_hw_offload: yes|no # optional
esp_tx_csum_hw_offload: yes|no # optional
fcoe_mtu: yes|no # optional
gro: yes|no # optional
gso: yes|no # optional
highdma: yes|no # optional
hw_tc_offload: yes|no # optional
l2_fwd_offload: yes|no # optional
loopback: yes|no # optional
lro: yes|no # optional
ntuple: yes|no # optional
rx: yes|no # optional
rx_all: yes|no # optional
rx_fcs: yes|no # optional
rx_gro_hw: yes|no # optional
rx_udp_tunnel_port_offload: yes|no # optional
rx_vlan_filter: yes|no # optional
rx_vlan_stag_filter: yes|no # optional
rx_vlan_stag_hw_parse: yes|no # optional
rxhash: yes|no # optional
rxvlan: yes|no # optional
sg: yes|no # optional
tls_hw_record: yes|no # optional
tls_hw_tx_offload: yes|no # optional
tso: yes|no # optional
tx: yes|no # optional
tx_checksum_fcoe_crc: yes|no # optional
tx_checksum_ip_generic: yes|no # optional
tx_checksum_ipv4: yes|no # optional
tx_checksum_ipv6: yes|no # optional
tx_checksum_sctp: yes|no # optional
tx_esp_segmentation: yes|no # optional
tx_fcoe_segmentation: yes|no # optional
tx_gre_csum_segmentation: yes|no # optional
tx_gre_segmentation: yes|no # optional
tx_gso_partial: yes|no # optional
tx_gso_robust: yes|no # optional
tx_ipxip4_segmentation: yes|no # optional
tx_ipxip6_segmentation: yes|no # optional
tx_nocache_copy: yes|no # optional
tx_scatter_gather: yes|no # optional
tx_scatter_gather_fraglist: yes|no # optional
tx_sctp_segmentation: yes|no # optional
tx_tcp_ecn_segmentation: yes|no # optional
tx_tcp_mangleid_segmentation: yes|no # optional
tx_tcp_segmentation: yes|no # optional
tx_tcp6_segmentation: yes|no # optional
tx_udp_segmentation: yes|no # optional
tx_udp_tnl_csum_segmentation: yes|no # optional
tx_udp_tnl_segmentation: yes|no # optional
tx_vlan_stag_hw_insert: yes|no # optional
txvlan: yes|no # optional
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: yes|no # optional
adaptive_tx: yes|no # optional
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
@ -787,7 +787,7 @@ SSL certificates and keys must be deployed on the host prior to running the role
- `system_ca_certs`
If set to `True`, NetworkManager will use the system's trusted ca
If set to `true`, NetworkManager will use the system's trusted ca
certificates to verify the EAP server.
- `domain_suffix_match`
@ -830,8 +830,8 @@ following options:
- `all_ports_active`
`all_slaves_active` in kernel and NetworkManager. The boolean value `False` drops
the duplicate frames (received on inactive ports) and the boolean value `True`
`all_slaves_active` in kernel and NetworkManager. The boolean value `false` drops
the duplicate frames (received on inactive ports) and the boolean value `true`
delivers the duplicate frames.
- `arp_all_targets`
@ -920,7 +920,7 @@ following options:
- `tlb_dynamic_lb`
This option specifies if dynamic shuffling of flows is enabled in tlb mode. The
boolean value `True` enables the flow shuffling while the boolean value `False`
boolean value `true` enables the flow shuffling while the boolean value `false`
disables it.
- `updelay`
@ -931,8 +931,8 @@ following options:
- `use_carrier`
This options specifies whether or not miimon should use MII or ETHTOOL ioctls
versus netif_carrier_ok() to determine the link sattus. The boolean value `True`
enables the use of netif_carrier_ok() while the boolean value `False` uses MII or
versus netif_carrier_ok() to determine the link sattus. The boolean value `true`
enables the use of netif_carrier_ok() while the boolean value `false` uses MII or
ETHTOOL ioctls instead.
- `xmit_hash_policy`
@ -952,7 +952,7 @@ network_connections:
type: ethernet
interface_name: eth0
ip:
dhcp4: yes
dhcp4: true
- name: Wired0
state: up
@ -981,10 +981,10 @@ network_connections:
- name: eth0
#persistent_state: present # default
type: ethernet
autoconnect: yes
autoconnect: true
mac: "00:00:5e:00:53:5d"
ip:
dhcp4: yes
dhcp4: true
```
Specifying a connecting profile for an ethernet device with the `ID_PATH`:
@ -1033,7 +1033,7 @@ network_connections:
type: ethernet
ethernet:
autoneg: no
autoneg: false
speed: 1000
duplex: full
```
@ -1055,8 +1055,8 @@ network_connections:
interface_name: br0
type: bridge
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
```
Setting `controller` and `port_type`:
@ -1081,15 +1081,15 @@ Configuring VLANs:
```yaml
network_connections:
- name: eth1-profile
autoconnet: no
autoconnect: false
type: ethernet
interface_name: eth1
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
- name: eth1.6
autoconnect: no
autoconnect: false
type: vlan
parent: eth1-profile
vlan:
@ -1097,7 +1097,7 @@ network_connections:
ip:
address:
- 192.0.2.5/24
auto6: no
auto6: false
```
Configuring MACVLAN:
@ -1116,8 +1116,8 @@ network_connections:
parent: eth0-profile
macvlan:
mode: bridge
promiscuous: yes
tap: no
promiscuous: true
tap: false
ip:
address:
- 192.168.1.1/24
@ -1145,8 +1145,8 @@ network_connections:
type: ethernet
ip:
route_metric4: 100
dhcp4: no
#dhcp4_send_hostname: no
dhcp4: false
#dhcp4_send_hostname: false
gateway4: 192.0.2.1
dns:
@ -1160,7 +1160,7 @@ network_connections:
- timeout:1
route_metric6: -1
auto6: no
auto6: false
gateway6: 2001:db8::1
address:
@ -1177,8 +1177,8 @@ network_connections:
prefix: 26
gateway: 198.51.100.6
metric: 4
route_append_only: no
rule_append_only: yes
route_append_only: false
rule_append_only: true
```
Configuring 802.1x:

View file

@ -2,24 +2,26 @@
---
network_connections: []
network_allow_restart: no
network_allow_restart: false
# Ansible distribution identifiers that the role treats like RHEL
__network_rh_distros:
- CentOS
- OracleLinux
- RedHat
- Rocky
# Use initscripts for RHEL/CentOS < 7, nm otherwise
network_provider_os_default: "{{
'initscripts' if ansible_distribution in [
'RedHat',
'CentOS',
'OracleLinux',
'Rocky'
] and ansible_distribution_major_version is version('7', '<')
else 'nm' }}"
'initscripts' if ansible_distribution in __network_rh_distros and
ansible_distribution_major_version is version('7', '<')
else 'nm' }}"
# If NetworkManager.service is running, assume that 'nm' is currently in-use,
# otherwise initscripts
__network_provider_current: "{{
'nm' if 'NetworkManager.service' in ansible_facts.services and
ansible_facts.services['NetworkManager.service']['state'] == 'running'
else 'initscripts'
}}"
else 'initscripts' }}"
# Default to the auto-detected value
network_provider: "{{ __network_provider_current }}"
@ -60,27 +62,27 @@ __network_packages_default_wpa_supplicant: ["{%
# - python-gobject-base on RHEL7 (no python2-gobject-base :-/)
# - python3-gobject-base on Fedora 28+
__network_packages_default_gobject_packages: ["python{{
ansible_python['version']['major'] | replace('2', '')}}-gobject-base"]
ansible_python['version']['major'] | replace('2', '') }}-gobject-base"]
__network_service_name_default_nm: NetworkManager
__network_packages_default_nm: "{{['NetworkManager']
+ __network_packages_default_gobject_packages|select()|list()
+ __network_packages_default_wpa_supplicant|select()|list()
+ __network_packages_default_wireless|select()|list()
+ __network_packages_default_team|select()|list()}}"
__network_packages_default_nm: "{{ ['NetworkManager']
+ __network_packages_default_gobject_packages | select() | list()
+ __network_packages_default_wpa_supplicant | select() | list()
+ __network_packages_default_wireless | select() | list()
+ __network_packages_default_team | select() | list() }}"
__network_service_name_default_initscripts: network
# initscripts requires bridge-utils to manage bridges, install it when the
# 'bridge' type is used in network_connections
__network_packages_default_initscripts_bridge: ["{%
if network_connections|selectattr('type', 'defined')|
selectattr('type', 'match', '^bridge$')|list|count>0 and
ansible_distribution in ['RedHat', 'CentOS', 'OracleLinux', 'Rocky'] and
if network_connections | selectattr('type', 'defined') |
selectattr('type', 'match', '^bridge$') | list | count > 0 and
ansible_distribution in __network_rh_distros and
ansible_distribution_major_version is version('7', '<=')
%}bridge-utils{% endif %}"]
__network_packages_default_initscripts_network_scripts: ["{%
if ansible_distribution in ['RedHat', 'CentOS', 'OracleLinux', 'Rocky'] and
if ansible_distribution in __network_rh_distros and
ansible_distribution_major_version is version('7', '<=')
%}initscripts{% else %}network-scripts{% endif %}"]
# convert _network_packages_default_initscripts_bridge to an empty list if it
@ -89,8 +91,8 @@ if ansible_distribution in ['RedHat', 'CentOS', 'OracleLinux', 'Rocky'] and
# (the empty string is false)
# |list() converts the generator that |select() creates to a list
__network_packages_default_initscripts: "{{
__network_packages_default_initscripts_bridge|select()|list()
+ __network_packages_default_initscripts_network_scripts|select()|list()
__network_packages_default_initscripts_bridge | select() | list()
+ __network_packages_default_initscripts_network_scripts | select() | list()
}}"

View file

@ -11,15 +11,15 @@
# ip configuration (optional)
ip:
address:
- "192.0.2.24/24"
- "2001:db8::23/64"
- 192.0.2.24/24
- 2001:db8::23/64
bond:
mode: 802.3ad
ad_actor_sys_prio: 65535
ad_actor_system: 00:00:5e:00:53:5d
ad_select: stable
ad_user_port_key: 1023
all_ports_active: True
all_ports_active: true
downdelay: 0
lacp_rate: slow
lp_interval: 128
@ -30,7 +30,7 @@
primary_reselect: better
resend_igmp: 225
updelay: 0
use_carrier: True
use_carrier: true
xmit_hash_policy: encap2+3
# add an ethernet profile to the bond
- name: member1
@ -47,4 +47,3 @@
controller: bond0
roles:
- linux-system-roles.network
...

View file

@ -11,8 +11,8 @@
# ip configuration (optional)
ip:
address:
- "192.0.2.24/24"
- "2001:db8::23/64"
- 192.0.2.24/24
- 2001:db8::23/64
# bond configuration settings: (optional)
bond:
mode: active-backup
@ -33,4 +33,3 @@
controller: bond0
roles:
- linux-system-roles.network
...

View file

@ -3,15 +3,14 @@
- hosts: network-test
vars:
network_connections:
# Create a bond profile, which is the parent of VLAN.
- name: prod2
state: up
type: bond
interface_name: bond2
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
bond:
mode: active-backup
miimon: 110
@ -32,7 +31,7 @@
vlan_id: 100
ip:
address:
- "192.0.2.{{ network_iphost }}/24"
- 192.0.2.{{ network_iphost }}/24
roles:
- linux-system-roles.network

View file

@ -3,15 +3,14 @@
- hosts: network-test
vars:
network_connections:
# Create a bridge profile, which is the parent of VLAN.
- name: prod2
state: up
type: bridge
interface_name: bridge2
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
# set an ethernet port to the bridge
- name: prod2-port1
@ -30,7 +29,7 @@
vlan_id: 100
ip:
address:
- "192.0.2.{{ network_iphost }}/24"
- 192.0.2.{{ network_iphost }}/24
roles:
- linux-system-roles.network

View file

@ -10,8 +10,7 @@
interface_name: dummy0
ip:
address:
- "192.0.2.42/30"
- 192.0.2.42/30
roles:
- linux-system-roles.network
...

View file

@ -7,7 +7,7 @@
type: ethernet
ip:
route_metric4: 100
dhcp4: no
dhcp4: false
gateway4: 192.0.2.1
dns_priority: 9999
dns:
@ -21,7 +21,7 @@
- timeout:1
route_metric6: -1
auto6: no
auto6: false
gateway6: 2001:db8::1
address:
@ -38,8 +38,7 @@
prefix: 26
gateway: 198.51.100.6
metric: 4
route_append_only: no
rule_append_only: yes
route_append_only: false
rule_append_only: true
roles:
- linux-system-roles.network
...

View file

@ -3,14 +3,13 @@
- hosts: network-test
vars:
network_connections:
# Create one ethernet profile and activate it.
# The profile uses automatic IP addressing
# and is tied to the interface by MAC address.
- name: prod1
state: up
type: ethernet
autoconnect: yes
autoconnect: true
mac: "{{ network_mac1 }}"
mtu: 1450

View file

@ -11,17 +11,17 @@
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"
private_key_password: p@55w0rD
client_cert: /etc/pki/tls/client.pem
ca_cert: /etc/pki/tls/cacert.pem
domain_suffix_match: example.com
# certs have to be deployed first
pre_tasks:
- name: copy certs/keys for 802.1x auth
- name: Copy certs/keys for 802.1x auth
copy:
src: "{{ item }}"
dest: "/etc/pki/tls/{{ item }}"
dest: /etc/pki/tls/{{ item }}
with_items:
- client.key
- client.pem

View file

@ -3,16 +3,15 @@
- hosts: network-test
vars:
network_connections:
# Create a profile for the underlying device of the VLAN.
- name: prod2
type: ethernet
autoconnect: no
autoconnect: false
state: up
interface_name: "{{ network_interface_name2 }}"
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
# on top of it, create a VLAN with ID 100 and static
# addressing
@ -23,7 +22,7 @@
vlan_id: 100
ip:
address:
- "192.0.2.{{ network_iphost }}/24"
- 192.0.2.{{ network_iphost }}/24
roles:
- linux-system-roles.network

View file

@ -2,7 +2,8 @@
---
- hosts: all
tasks:
- include_role:
- name: Configure ethernet coalesce
include_role:
name: linux-system-roles.network
vars:
network_connections:
@ -10,12 +11,12 @@
state: up
type: ethernet
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
ethtool:
coalesce:
adaptive_rx: yes
adaptive_tx: no
adaptive_rx: true
adaptive_tx: false
pkt_rate_high: 128
pkt_rate_low: 128
rx_frames: 128

View file

@ -2,7 +2,8 @@
---
- hosts: all
tasks:
- include_role:
- name: Configure ethernet paramters
include_role:
name: linux-system-roles.network
vars:
network_connections:
@ -10,10 +11,10 @@
state: up
type: ethernet
ip:
dhcp4: "no"
auto6: "no"
dhcp4: false
auto6: false
ethtool:
features:
gro: "no"
gso: "yes"
tx_sctp_segmentation: "no"
gro: false
gso: true
tx_sctp_segmentation: false

View file

@ -2,7 +2,8 @@
---
- hosts: all
tasks:
- include_role:
- name: Configure ethernet features
include_role:
name: linux-system-roles.network
vars:
network_connections:
@ -10,5 +11,5 @@
state: up
type: ethernet
ip:
dhcp4: "no"
auto6: "no"
dhcp4: false
auto6: false

View file

@ -2,7 +2,8 @@
---
- hosts: all
tasks:
- include_role:
- name: Configure ring parameters
include_role:
name: linux-system-roles.network
vars:
network_connections:
@ -10,8 +11,8 @@
state: up
type: ethernet
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
ethtool:
ring:
rx: 128

View file

@ -3,7 +3,6 @@
- hosts: network-test
vars:
network_connections:
- name: ib0
type: infiniband
interface_name: ib0
@ -12,13 +11,13 @@
- name: ib0-10
interface_name: ib0.000a
type: infiniband
autoconnect: yes
autoconnect: true
infiniband_p_key: 10
parent: ib0
state: up
ip:
dhcp4: no
auto6: no
dhcp4: false
auto6: false
address:
- 198.51.100.133/30

View file

@ -9,4 +9,3 @@
ipv6_disabled: true
roles:
- linux-system-roles.network
...

View file

@ -3,7 +3,6 @@
- hosts: network-test
vars:
network_connections:
- name: eth0
type: ethernet
state: up
@ -19,8 +18,8 @@
parent: eth0
macvlan:
mode: bridge
promiscuous: True
tap: False
promiscuous: true
tap: false
ip:
address:
- 192.168.1.1/24

View file

@ -9,9 +9,8 @@
path:
- pci-0000:00:03.0
ip:
dhcp4: no
dhcp4: false
address:
- 192.0.2.3/24
roles:
- linux-system-roles.network
...

View file

@ -48,4 +48,3 @@
- 8.8.8.8
roles:
- linux-system-roles.network
...

View file

@ -9,4 +9,3 @@
state: down
roles:
- linux-system-roles.network
...

View file

@ -5,9 +5,9 @@
- name: Add a new routing table
lineinfile:
path: /etc/iproute2/rt_tables.d/table.conf
line: "200 custom"
line: 200 custom
mode: "0644"
create: yes
create: true
- name: Configure connection profile and specify the table in static routes
import_role:
@ -17,9 +17,9 @@
- name: eth0
type: ethernet
state: up
autoconnect: yes
autoconnect: true
ip:
dhcp4: no
dhcp4: false
address:
- 198.51.100.3/26
route:
@ -33,4 +33,3 @@
gateway: 198.51.100.6
metric: 4
table: custom
...

View file

@ -11,8 +11,8 @@
# ip configuration (optional)
ip:
address:
- "192.0.2.24/24"
- "2001:db8::23/64"
- 192.0.2.24/24
- 2001:db8::23/64
# add an team profile to the team
- name: member1
@ -30,4 +30,3 @@
roles:
- linux-system-roles.network
...

View file

@ -6,7 +6,7 @@
- name: wlan0
type: wireless
wireless:
ssid: "My Enhanced Open(OWE) Network"
key_mgmt: "owe"
ssid: My Enhanced Open(OWE) Network
key_mgmt: owe
roles:
- linux-system-roles.network

View file

@ -6,12 +6,11 @@
- name: wlan0
type: wireless
wireless:
ssid: "My WPA3-Personal Network"
key_mgmt: "sae"
ssid: My WPA3-Personal Network
key_mgmt: sae
# recommend vault encrypting the wireless password
# see https://docs.ansible.com/ansible/latest/user_guide/vault.html
password: "p@55w0rD"
password: p@55w0rD
roles:
- linux-system-roles.network

View file

@ -6,10 +6,10 @@
- name: wlan0
type: wireless
wireless:
ssid: "My WPA2-PSK Network"
key_mgmt: "wpa-psk"
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"
password: p@55w0rD
roles:
- linux-system-roles.network

View file

@ -6,7 +6,6 @@ galaxy_info:
company: Red Hat, Inc.
license: BSD-3-Clause
min_ansible_version: "2.9"
github_branch: main
galaxy_tags:
- centos
- fedora
@ -21,7 +20,7 @@ galaxy_info:
- all
- name: EL
versions:
- 6
- 7
- 8
- 9
- "6"
- "7"
- "8"
- "9"

View file

@ -18,8 +18,6 @@ GET_NM_VERSION = """
state: present
- name: Get NetworkManager version
command: rpm -q --qf "%{version}" NetworkManager
args:
warn: false
register: NetworkManager_version
when: true
when:

View file

@ -2,10 +2,10 @@
---
- block:
- name: Create EPEL {{ ansible_distribution_major_version }}
# yamllint disable-line rule:line-length
command: rpm -iv https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
args:
warn: false
command:
cmd: >-
rpm -iv https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{
ansible_distribution_major_version }}.noarch.rpm
creates: /etc/yum.repos.d/epel.repo
register: __epel_status
# sometimes the rpm download returns a 403 - I think it is when too
@ -19,14 +19,10 @@
- name: Enable EPEL 7
command: yum-config-manager --enable epel
when: ansible_distribution_major_version == '7'
args:
warn: false
- name: Enable EPEL 8
command: dnf config-manager --set-enabled epel
when: ansible_distribution_major_version == '8'
args:
warn: false
when:
- ansible_distribution in ['RedHat', 'CentOS']
- ansible_distribution_major_version in ['7', '8']

View file

@ -4,7 +4,6 @@
- name: Get NetworkManager RPM version
command:
cmd: rpm -qa --qf '%{name}-%{version}-%{release}\n' NetworkManager
warn: false
register: __rpm_q_NetworkManager
- name: Store NetworkManager version

View file

@ -39,8 +39,6 @@
dnf -y install koji
koji download-build --arch=$(uname -p) kernel-modules-internal-$(uname -r)
dnf -y install kernel-modules*.rpm
args:
warn: false
when:
- ansible_distribution == 'Fedora'

View file

@ -46,7 +46,6 @@
- name: Get NetworkManager version
command:
cmd: rpm -qa NetworkManager
warn: false
register: __network_NM_NVR
changed_when: false
- block:

View file

@ -19,8 +19,6 @@
state: present
- name: Get NetworkManager version
command: rpm -q --qf "%{version}" NetworkManager
args:
warn: false
register: NetworkManager_version
when: true
when:

View file

@ -19,8 +19,6 @@
state: present
- name: Get NetworkManager version
command: rpm -q --qf "%{version}" NetworkManager
args:
warn: false
register: NetworkManager_version
when: true
when:

View file

@ -19,8 +19,6 @@
state: present
- name: Get NetworkManager version
command: rpm -q --qf "%{version}" NetworkManager
args:
warn: false
register: NetworkManager_version
when: true
when:

View file

@ -19,8 +19,6 @@
state: present
- name: Get NetworkManager version
command: rpm -q --qf "%{version}" NetworkManager
args:
warn: false
register: NetworkManager_version
when: true
when:

View file

@ -19,8 +19,6 @@
state: present
- name: Get NetworkManager version
command: rpm -q --qf "%{version}" NetworkManager
args:
warn: false
register: NetworkManager_version
when: true
when:

View file

@ -14,8 +14,6 @@
state: present
- name: Get NetworkManager version
command: rpm -q --qf "%{version}" NetworkManager
args:
warn: "no"
when: true
register: NetworkManager_version