mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
refactor: handle INJECT_FACTS_AS_VARS=false by using ansible_facts instead
Ansible 2.20 has deprecated the use of Ansible facts as variables. For example, `ansible_distribution` is now deprecated in favor of `ansible_facts["distribution"]`. This is due to making the default setting `INJECT_FACTS_AS_VARS=false`. For now, this will create WARNING messages, but in Ansible 2.24 it will be an error. See https://docs.ansible.com/projects/ansible/latest/porting_guides/porting_guide_core_2.20.html#inject-facts-as-vars Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
parent
bc67de4f3c
commit
04d69c543d
76 changed files with 199 additions and 201 deletions
|
|
@ -19,16 +19,16 @@ __network_rh_distros:
|
|||
__network_rh_distros_fedora: "{{ __network_rh_distros + ['Fedora'] }}"
|
||||
|
||||
# Use this in conditionals to check if distro is Red Hat or clone
|
||||
__network_is_rh_distro: "{{ ansible_distribution in __network_rh_distros }}"
|
||||
__network_is_rh_distro: "{{ ansible_facts['distribution'] in __network_rh_distros }}"
|
||||
|
||||
# Use this in conditionals to check if distro is Red Hat or clone, or Fedora
|
||||
__network_is_rh_distro_fedora: "{{ ansible_distribution in __network_rh_distros_fedora }}"
|
||||
__network_is_rh_distro_fedora: "{{ ansible_facts['distribution'] in __network_rh_distros_fedora }}"
|
||||
# END - DO NOT EDIT THIS BLOCK - rh distros variables
|
||||
|
||||
# Use initscripts for RHEL/CentOS < 7, nm otherwise
|
||||
network_provider_os_default: "{{
|
||||
'initscripts' if ansible_distribution in __network_rh_distros and
|
||||
ansible_distribution_major_version is version('7', '<')
|
||||
'initscripts' if ansible_facts['distribution'] in __network_rh_distros and
|
||||
ansible_facts['distribution_major_version'] is version('7', '<')
|
||||
else 'nm' }}"
|
||||
# If NetworkManager.service is running, assume that 'nm' is currently in-use,
|
||||
# otherwise initscripts
|
||||
|
|
@ -76,7 +76,7 @@ __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_facts['python']['version']['major'] | replace('2', '') }}-gobject-base"]
|
||||
|
||||
__network_service_name_default_nm: NetworkManager
|
||||
__network_packages_default_nm: "{{ ['NetworkManager']
|
||||
|
|
@ -92,18 +92,18 @@ __network_service_name_default_initscripts: network
|
|||
__network_packages_default_initscripts_bridge: ["{%
|
||||
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', '<=')
|
||||
ansible_facts['distribution'] in __network_rh_distros and
|
||||
ansible_facts['distribution_major_version'] is version('7', '<=')
|
||||
%}bridge-utils{% endif %}"]
|
||||
__network_packages_default_initscripts_network_scripts: ["{%
|
||||
if ansible_distribution in __network_rh_distros and
|
||||
ansible_distribution_major_version is version('7', '<=')
|
||||
if ansible_facts['distribution'] in __network_rh_distros and
|
||||
ansible_facts['distribution_major_version'] is version('7', '<=')
|
||||
%}initscripts{% else %}network-scripts{% endif %}"]
|
||||
# Initscripts provider requires `/sbin/dhclient` to obtain DHCP address,
|
||||
# which is provided by the dhcp client package
|
||||
__network_packages_default_initscripts_dhcp_client: ["{%
|
||||
if ansible_distribution in __network_rh_distros and
|
||||
ansible_distribution_major_version is version('7', '<=')
|
||||
if ansible_facts['distribution'] in __network_rh_distros and
|
||||
ansible_facts['distribution_major_version'] is version('7', '<=')
|
||||
%}dhclient{% else %}dhcp-client{% endif %}"]
|
||||
# convert _network_packages_default_initscripts_bridge to an empty list if it
|
||||
# contains only the empty string and add it to the default package list
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@
|
|||
supported since RHEL-8
|
||||
when:
|
||||
- network_state != {}
|
||||
- ansible_distribution_major_version | int < 8
|
||||
- ansible_facts["distribution_major_version"] | int < 8
|
||||
|
||||
- name: Abort applying teaming configuration if the system version
|
||||
of the managed host is EL10 or later
|
||||
fail:
|
||||
msg: >-
|
||||
Teaming is not supported in
|
||||
{{ ansible_distribution }}-{{ ansible_distribution_major_version }} -
|
||||
{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }} -
|
||||
use bonding instead
|
||||
when:
|
||||
- ansible_distribution_major_version | int > 9
|
||||
- ansible_distribution in __network_rh_distros
|
||||
- ansible_facts["distribution_major_version"] | int > 9
|
||||
- ansible_facts["distribution"] in __network_rh_distros
|
||||
- network_connections | selectattr("type", "defined") |
|
||||
selectattr("type", "match", "^team$") | list | length > 0 or
|
||||
network_state.get("interfaces", []) | selectattr("type", "defined") |
|
||||
|
|
@ -49,8 +49,8 @@
|
|||
register: dnf_package_update_info
|
||||
check_mode: true
|
||||
when:
|
||||
- ansible_distribution == 'Fedora' or
|
||||
ansible_distribution_major_version | int > 7
|
||||
- ansible_facts["distribution"] == 'Fedora' or
|
||||
ansible_facts["distribution_major_version"] | int > 7
|
||||
- __network_wireless_connections_defined
|
||||
or __network_team_connections_defined
|
||||
- not __network_is_ostree
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
register: yum_package_update_info
|
||||
check_mode: true
|
||||
when:
|
||||
- ansible_distribution_major_version | int < 8
|
||||
- ansible_facts["distribution_major_version"] | int < 8
|
||||
- __network_wireless_connections_defined
|
||||
or __network_team_connections_defined
|
||||
- not __network_is_ostree
|
||||
|
|
@ -112,10 +112,10 @@
|
|||
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
|
||||
when:
|
||||
- network_state != {}
|
||||
- ansible_distribution == 'Fedora' and
|
||||
ansible_distribution_major_version | int > 27 or
|
||||
ansible_distribution != 'Fedora' and
|
||||
ansible_distribution_major_version | int > 7
|
||||
- ansible_facts["distribution"] == 'Fedora' and
|
||||
ansible_facts["distribution_major_version"] | int > 27 or
|
||||
ansible_facts["distribution"] != 'Fedora' and
|
||||
ansible_facts["distribution_major_version"] | int > 7
|
||||
|
||||
- name: Install python3-libnmstate when using network_state variable
|
||||
package:
|
||||
|
|
@ -126,10 +126,10 @@
|
|||
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
|
||||
when:
|
||||
- network_state != {}
|
||||
- ansible_distribution == 'Fedora' and
|
||||
ansible_distribution_major_version | int > 34 or
|
||||
ansible_distribution != 'Fedora' and
|
||||
ansible_distribution_major_version | int > 8
|
||||
- ansible_facts["distribution"] == 'Fedora' and
|
||||
ansible_facts["distribution_major_version"] | int > 34 or
|
||||
ansible_facts["distribution"] != 'Fedora' and
|
||||
ansible_facts["distribution_major_version"] | int > 8
|
||||
|
||||
# If network packages changed and wireless or team connections are specified,
|
||||
# NetworkManager must be restarted, and the user needs to explicitly consent
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import sys
|
|||
GET_NM_VERSION = """
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -58,7 +58,7 @@ RUN_PLAYBOOK_WITH_NM = """# SPDX-License-Identifier: BSD-3-Clause
|
|||
{comment}- name: Import the playbook '{test_playbook}'
|
||||
import_playbook: {test_playbook}
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
{minimum_nm_version_check}{extra_run_condition}"""
|
||||
|
||||
MINIMUM_VERSION = "minimum_version"
|
||||
|
|
@ -66,16 +66,16 @@ EXTRA_RUN_CONDITION = "extra_run_condition"
|
|||
NM_ONLY_TESTS = {
|
||||
"playbooks/tests_802_1x_updated.yml": {
|
||||
EXTRA_RUN_CONDITION: (
|
||||
"(ansible_distribution != 'RedHat' and\n"
|
||||
" ansible_distribution_major_version | int > 7) or\n"
|
||||
" ansible_distribution_major_version | int == 8"
|
||||
"(ansible_facts['distribution'] != 'RedHat' and\n"
|
||||
" ansible_facts['distribution_major_version'] | int > 7) or\n"
|
||||
" ansible_facts['distribution_major_version'] | int == 8"
|
||||
),
|
||||
},
|
||||
"playbooks/tests_802_1x.yml": {
|
||||
EXTRA_RUN_CONDITION: (
|
||||
"(ansible_distribution != 'RedHat' and\n"
|
||||
" ansible_distribution_major_version | int > 7) or\n"
|
||||
" ansible_distribution_major_version | int == 8"
|
||||
"(ansible_facts['distribution'] != 'RedHat' and\n"
|
||||
" ansible_facts['distribution_major_version'] | int > 7) or\n"
|
||||
" ansible_facts['distribution_major_version'] | int == 8"
|
||||
),
|
||||
},
|
||||
"playbooks/tests_ignore_auto_dns.yml": {},
|
||||
|
|
@ -94,10 +94,10 @@ NM_ONLY_TESTS = {
|
|||
MINIMUM_VERSION: "'1.20.0'",
|
||||
"comment": "# NetworKmanager 1.20.0 added support for forgetting profiles",
|
||||
EXTRA_RUN_CONDITION: (
|
||||
"(ansible_distribution == 'Fedora'\n"
|
||||
" and ansible_distribution_major_version | int < 41)\n"
|
||||
" or ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']\n"
|
||||
" or ansible_distribution_major_version | int < 9"
|
||||
"(ansible_facts['distribution'] == 'Fedora'\n"
|
||||
" and ansible_facts['distribution_major_version'] | int < 41)\n"
|
||||
" or ansible_facts['distribution'] not in ['RedHat', 'CentOS', 'Fedora']\n"
|
||||
" or ansible_facts['distribution_major_version'] | int < 9"
|
||||
),
|
||||
},
|
||||
"playbooks/tests_eth_pci_address_match.yml": {
|
||||
|
|
@ -105,7 +105,7 @@ NM_ONLY_TESTS = {
|
|||
"comment": "# NetworkManager 1.26.0 added support for match.path setting",
|
||||
},
|
||||
"playbooks/tests_network_state.yml": {
|
||||
EXTRA_RUN_CONDITION: "ansible_distribution_major_version | int > 7",
|
||||
EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] | int > 7",
|
||||
},
|
||||
"playbooks/tests_reapply.yml": {},
|
||||
"playbooks/tests_route_table.yml": {},
|
||||
|
|
@ -117,32 +117,30 @@ blackhole, prohibit and unreachable",
|
|||
"playbooks/tests_routing_rules.yml": {},
|
||||
# teaming support dropped in EL10
|
||||
"playbooks/tests_team.yml": {
|
||||
EXTRA_RUN_CONDITION: "ansible_distribution not in ['RedHat', 'CentOS'] or\n ansible_distr\
|
||||
ibution_major_version | int < 10",
|
||||
EXTRA_RUN_CONDITION: "ansible_facts['distribution'] not in ['RedHat', 'CentOS'] or\n ansible_facts['distribution_major_version'] | int < 10",
|
||||
},
|
||||
"playbooks/tests_team_plugin_installation.yml": {
|
||||
EXTRA_RUN_CONDITION: "ansible_distribution not in ['RedHat', 'CentOS'] or\n ansible_distr\
|
||||
ibution_major_version | int < 10",
|
||||
EXTRA_RUN_CONDITION: "ansible_facts['distribution'] not in ['RedHat', 'CentOS'] or\n ansible_facts['distribution_major_version'] | int < 10",
|
||||
},
|
||||
# mac80211_hwsim (used for tests_wireless) only seems to be available
|
||||
# and working on RHEL/CentOS 7
|
||||
"playbooks/tests_wireless.yml": {
|
||||
EXTRA_RUN_CONDITION: "ansible_distribution_major_version == '7'",
|
||||
EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] == '7'",
|
||||
},
|
||||
"playbooks/tests_wireless_and_network_restart.yml": {},
|
||||
"playbooks/tests_wireless_plugin_installation.yml": {},
|
||||
"playbooks/tests_wireless_wpa3_owe.yml": {
|
||||
"comment": "# OWE has not been supported by NetworkManager 1.18.8 on \
|
||||
RHEL 7(dist-tag). Failed in setting up mock wifi on RHEL 8",
|
||||
EXTRA_RUN_CONDITION: "ansible_distribution_major_version > '7' and \
|
||||
ansible_distribution == 'CentOS' or\n ansible_distribution_major_version > '32' \
|
||||
and ansible_distribution == 'Fedora'",
|
||||
EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] > '7' and \
|
||||
ansible_facts['distribution'] == 'CentOS' or\n ansible_facts['distribution_major_version'] > '32' \
|
||||
and ansible_facts['distribution'] == 'Fedora'",
|
||||
},
|
||||
"playbooks/tests_wireless_wpa3_sae.yml": {
|
||||
"comment": "# SAE has not been supported by NetworkManager 1.18.8 on \
|
||||
RHEL 7. Failed in setting up mock wifi on RHEL 8",
|
||||
EXTRA_RUN_CONDITION: "ansible_distribution_major_version != '7' and \
|
||||
ansible_distribution != 'RedHat'",
|
||||
EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] != '7' and \
|
||||
ansible_facts['distribution'] != 'RedHat'",
|
||||
},
|
||||
}
|
||||
# NM_CONDITIONAL_TESTS is used to store the test playbooks which are demanding for NM
|
||||
|
|
@ -187,8 +185,8 @@ RUN_PLAYBOOK_WITH_INITSCRIPTS = """# SPDX-License-Identifier: BSD-3-Clause
|
|||
|
||||
- name: Import the playbook '{test_playbook}'
|
||||
import_playbook: {test_playbook}
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and\n \
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and\n \
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
when:
|
||||
- network_provider == 'nm'
|
||||
# RHEL up to 8 uses initscripts backend
|
||||
- ansible_distribution_major_version | int >= 9
|
||||
- ansible_facts["distribution_major_version"] | int >= 9
|
||||
|
||||
- name: Assert settings in NM connection file
|
||||
assert:
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
when:
|
||||
- network_provider == 'nm'
|
||||
# RHEL up to 8 uses initscripts backend
|
||||
- ansible_distribution_major_version | int >= 9
|
||||
- ansible_facts["distribution_major_version"] | int >= 9
|
||||
|
||||
- name: Get NM connection status
|
||||
command: "nmcli connection show {{ interface }}"
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
slurp:
|
||||
src: "/etc/sysconfig/network-scripts/ifcfg-{{ interface }}"
|
||||
register: initscripts_connection_file
|
||||
when: network_provider == 'initscripts' or ansible_distribution_major_version | int < 9
|
||||
when: network_provider == 'initscripts' or ansible_facts["distribution_major_version"] | int < 9
|
||||
|
||||
- name: Assert settings in initscripts connection file
|
||||
assert:
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
- "'DEVICE={{ interface }}' in initscripts_connection_file.content | b64decode"
|
||||
- "'IPADDR=192.0.2.1' in initscripts_connection_file.content | b64decode"
|
||||
- "'PREFIX=24' in initscripts_connection_file.content | b64decode"
|
||||
when: network_provider == 'initscripts' or ansible_distribution_major_version | int < 9
|
||||
when: network_provider == 'initscripts' or ansible_facts["distribution_major_version"] | int < 9
|
||||
|
||||
- name: Include the tasks 'down_profile+delete_interface.yml'
|
||||
include_tasks: tasks/down_profile+delete_interface.yml
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
ip netns exec ns1 ip link set peer{{ interface }} up
|
||||
when:
|
||||
# netns not available on RHEL/CentOS 6
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
changed_when: false
|
||||
- name: Test IPv6 config
|
||||
block:
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
- name: Test gateway can be pinged
|
||||
command: ping6 -c1 2001:db8::1
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
changed_when: false
|
||||
always:
|
||||
- name: "TEARDOWN: remove profiles."
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
- name: Clean up namespace
|
||||
command: ip netns delete ns1
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
changed_when: false
|
||||
- name: Verify network state restored to default
|
||||
include_tasks: tasks/check_network_dns.yml
|
||||
|
|
|
|||
|
|
@ -126,14 +126,14 @@
|
|||
state: up
|
||||
ignore_errors: true # noqa ignore-errors
|
||||
changed_when: false
|
||||
when: ansible_distribution_major_version | int > 7
|
||||
when: ansible_facts["distribution_major_version"] | int > 7
|
||||
|
||||
- name: Assert that reconfiguring network connection is failed
|
||||
assert:
|
||||
that:
|
||||
- __network_connections_result.failed
|
||||
msg: reconfiguring network connection is not failed
|
||||
when: ansible_distribution_major_version | int > 7
|
||||
when: ansible_facts["distribution_major_version"] | int > 7
|
||||
|
||||
- name: Assert that configuring DNS search setting is not allowed when
|
||||
both IPv4 and IPv6 are disabled
|
||||
|
|
@ -145,7 +145,7 @@
|
|||
msg: Reconfiguring network connection is not failed with the error
|
||||
"Setting 'dns_search', 'dns_options', and 'dns_priority' are not
|
||||
allowed when both IPv4 and IPv6 are disabled."
|
||||
when: ansible_distribution_major_version | int > 7
|
||||
when: ansible_facts["distribution_major_version"] | int > 7
|
||||
|
||||
always:
|
||||
- name: Clean up the test device and the connection profile
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@
|
|||
until NM 1.20")
|
||||
msg: The routing rule attribute 'suppress_prefixlength' validation
|
||||
failure is not raised when the distro's major version is 7
|
||||
when: ansible_distribution_major_version == "7"
|
||||
when: ansible_facts['distribution_major_version'] == "7"
|
||||
|
||||
- name: Clear errors
|
||||
meta: clear_host_errors
|
||||
|
|
@ -161,28 +161,28 @@
|
|||
register: route_rule_table_30200
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Get the routing rule for looking up the table 30400
|
||||
command: ip rule list table 30400
|
||||
register: route_rule_table_30400
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Get the routing rule for looking up the table 30600
|
||||
command: ip -6 rule list table 30600
|
||||
register: route_rule_table_30600
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Get the routing rule for looking up the table 'custom'
|
||||
command: ip rule list table custom
|
||||
register: route_rule_table_custom
|
||||
ignore_errors: true
|
||||
changed_when: false
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Get the IPv4 routing rule for the connection "{{ interface }}"
|
||||
command: nmcli -f ipv4.routing-rules c show "{{ interface }}"
|
||||
|
|
@ -216,7 +216,7 @@
|
|||
30200 suppress_prefixlength 8")
|
||||
msg: "the routing rule with table lookup 30200 does not match the
|
||||
specified rule"
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Assert that the routing rule with table lookup 30400 matches the
|
||||
specified rule
|
||||
|
|
@ -230,7 +230,7 @@
|
|||
oiftest \[detached\] lookup 30400")
|
||||
msg: "the routing rule with table lookup 30400 does not match the
|
||||
specified rule"
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Assert that the routing rule with table lookup 30600 matches the
|
||||
specified rule
|
||||
|
|
@ -246,7 +246,7 @@
|
|||
lookup 30600 suppress_prefixlength 24")
|
||||
msg: "the routing rule with table lookup 30600 does not match the
|
||||
specified rule"
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Assert that the routing rule with 'custom' table lookup matches the
|
||||
specified rule
|
||||
|
|
@ -256,7 +256,7 @@
|
|||
198.51.100.56/26 lookup custom")
|
||||
msg: "the routing rule with 'custom' table lookup does not match the
|
||||
specified rule"
|
||||
when: ansible_distribution_major_version != "7"
|
||||
when: ansible_facts['distribution_major_version'] != "7"
|
||||
|
||||
- name: Assert that the specified IPv4 routing rule was configured in the
|
||||
connection "{{ interface }}"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
tasks:
|
||||
- name: "INIT: wireless tests"
|
||||
include_tasks: tasks/setup_mock_wifi_wpa3_sae.yml
|
||||
when: ansible_distribution in ['CentOS', 'Fedora']
|
||||
when: ansible_facts['distribution'] in ['CentOS', 'Fedora']
|
||||
|
||||
- name: Test wireless connection with WPA3 Personal
|
||||
block:
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
- name: "{{ interface }}"
|
||||
# set `state: down` on RHEL 8 since we failed in setting up mock
|
||||
# wifi on RHEL 8
|
||||
state: "{{ 'down' if ansible_distribution == 'RedHat' else 'up' }}"
|
||||
state: "{{ 'down' if ansible_facts['distribution'] == 'RedHat' else 'up' }}"
|
||||
type: wireless
|
||||
ip:
|
||||
address:
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
use: "{{ (__network_is_ostree | d(false)) |
|
||||
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_distribution_major_version is version('6', '<=')
|
||||
- ansible_facts['os_family'] == 'RedHat'
|
||||
- ansible_facts['distribution_major_version'] is version('6', '<=')
|
||||
|
||||
- name: Install pgrep, sysctl
|
||||
package:
|
||||
|
|
@ -32,8 +32,8 @@
|
|||
use: "{{ (__network_is_ostree | d(false)) |
|
||||
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_distribution_major_version is version('7', '>=')
|
||||
- ansible_facts['os_family'] == 'RedHat'
|
||||
- ansible_facts['distribution_major_version'] is version('7', '>=')
|
||||
|
||||
- name: Create test interfaces
|
||||
shell: |
|
||||
|
|
|
|||
|
|
@ -48,5 +48,5 @@
|
|||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
||||
mode: "0644"
|
||||
when:
|
||||
- ansible_distribution == 'CentOS'
|
||||
- ansible_distribution_major_version == '6'
|
||||
- ansible_facts['distribution'] == 'CentOS'
|
||||
- ansible_facts['distribution_major_version'] == '6'
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
- name: Install hostapd via CentOS Stream
|
||||
command: dnf -y install http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/hostapd-2.10-1.el8.x86_64.rpm # noqa yaml[line-length]
|
||||
when:
|
||||
- ansible_distribution_version is version('8.6', '<')
|
||||
- ansible_distribution_major_version == '8'
|
||||
- ansible_distribution == 'RedHat'
|
||||
- ansible_facts['distribution_version'] is version('8.6', '<')
|
||||
- ansible_facts['distribution_major_version'] == '8'
|
||||
- ansible_facts['distribution'] == 'RedHat'
|
||||
changed_when: false
|
||||
|
||||
- name: Install hostapd
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
delay: 10
|
||||
|
||||
- name: Check if can test on CentOS and setup if possible
|
||||
when: ansible_distribution == 'CentOS'
|
||||
when: ansible_facts['distribution'] == 'CentOS'
|
||||
block:
|
||||
# It is currently too difficult to install the required kernel
|
||||
# if using rpm ostree - so just skip this test
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
dnf -y copr enable liangwen12year/hostapd-owe
|
||||
dnf -y install hostapd
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_facts['distribution'] == 'Fedora'
|
||||
changed_when: false
|
||||
|
||||
- name: Install mac80211_hwsim kernel modules in Fedora
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
koji download-build --arch=$(uname -m) kernel-modules-internal-$(uname -r)
|
||||
dnf -y install kernel-modules*.rpm
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_facts['distribution'] == 'Fedora'
|
||||
changed_when: false
|
||||
|
||||
- name: Create hostapd config
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
delay: 10
|
||||
|
||||
- name: Configure CentOS system for testing, if possible
|
||||
when: ansible_distribution == 'CentOS'
|
||||
when: ansible_facts['distribution'] == 'CentOS'
|
||||
block:
|
||||
# It is currently too difficult to install the required kernel
|
||||
# if using rpm ostree - so just skip this test
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
- hostapd
|
||||
state: present
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_facts['distribution'] == 'Fedora'
|
||||
register: __install_status
|
||||
until: __install_status is success
|
||||
retries: 6
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
koji download-build --arch=$(uname -m) kernel-modules-internal-$(uname -r)
|
||||
dnf -y install kernel-modules*.rpm
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_facts['distribution'] == 'Fedora'
|
||||
changed_when: false
|
||||
|
||||
- name: Create hostapd config
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
- name: Import the playbook 'playbooks/tests_802_1x.yml'
|
||||
import_playbook: playbooks/tests_802_1x.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- (ansible_distribution != 'RedHat' and
|
||||
ansible_distribution_major_version | int > 7) or
|
||||
ansible_distribution_major_version | int == 8
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- (ansible_facts['distribution'] != 'RedHat' and
|
||||
ansible_facts['distribution_major_version'] | int > 7) or
|
||||
ansible_facts['distribution_major_version'] | int == 8
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
- name: Import the playbook 'playbooks/tests_802_1x_updated.yml'
|
||||
import_playbook: playbooks/tests_802_1x_updated.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- (ansible_distribution != 'RedHat' and
|
||||
ansible_distribution_major_version | int > 7) or
|
||||
ansible_distribution_major_version | int == 8
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- (ansible_facts['distribution'] != 'RedHat' and
|
||||
ansible_facts['distribution_major_version'] | int > 7) or
|
||||
ansible_facts['distribution_major_version'] | int == 8
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_auto_gateway.yml'
|
||||
import_playbook: playbooks/tests_auto_gateway.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_auto_gateway.yml'
|
||||
import_playbook: playbooks/tests_auto_gateway.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_bond_cloned_mac.yml'
|
||||
import_playbook: playbooks/tests_bond_cloned_mac.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bond_cloned_mac.yml'
|
||||
import_playbook: playbooks/tests_bond_cloned_mac.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_bond_deprecated.yml'
|
||||
import_playbook: playbooks/tests_bond_deprecated.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bond_deprecated.yml'
|
||||
import_playbook: playbooks/tests_bond_deprecated.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_bond.yml'
|
||||
import_playbook: playbooks/tests_bond.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bond.yml'
|
||||
import_playbook: playbooks/tests_bond.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bond_options.yml'
|
||||
import_playbook: playbooks/tests_bond_options.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bond_port_match_by_mac.yml'
|
||||
import_playbook: playbooks/tests_bond_port_match_by_mac.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_bond_removal.yml'
|
||||
import_playbook: playbooks/tests_bond_removal.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bond_removal.yml'
|
||||
import_playbook: playbooks/tests_bond_removal.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_bridge_cloned_mac.yml'
|
||||
import_playbook: playbooks/tests_bridge_cloned_mac.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bridge_cloned_mac.yml'
|
||||
import_playbook: playbooks/tests_bridge_cloned_mac.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_bridge.yml'
|
||||
import_playbook: playbooks/tests_bridge.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_bridge.yml'
|
||||
import_playbook: playbooks/tests_bridge.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
|
||||
- name: Import the playbook 'tests_default.yml'
|
||||
import_playbook: tests_default.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
- name: Import the playbook 'tests_default.yml'
|
||||
import_playbook: tests_default.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_dummy.yml'
|
||||
import_playbook: playbooks/tests_dummy.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_eth_dns_support.yml'
|
||||
import_playbook: playbooks/tests_eth_dns_support.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -40,6 +40,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_eth_pci_address_match.yml'
|
||||
import_playbook: playbooks/tests_eth_pci_address_match.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
||||
- networkmanager_version is version('1.26.0', '>=')
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_ethernet.yml'
|
||||
import_playbook: playbooks/tests_ethernet.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_ethernet.yml'
|
||||
import_playbook: playbooks/tests_ethernet.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_ethtool_coalesce.yml'
|
||||
import_playbook: playbooks/tests_ethtool_coalesce.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -40,6 +40,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_ethtool_coalesce.yml'
|
||||
import_playbook: playbooks/tests_ethtool_coalesce.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
||||
- networkmanager_version is version('1.25.1', '>=')
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_ethtool_features.yml'
|
||||
import_playbook: playbooks/tests_ethtool_features.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -40,6 +40,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_ethtool_features.yml'
|
||||
import_playbook: playbooks/tests_ethtool_features.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
||||
- networkmanager_version is version('1.20.0', '>=')
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_ethtool_ring.yml'
|
||||
import_playbook: playbooks/tests_ethtool_ring.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -40,6 +40,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_ethtool_ring.yml'
|
||||
import_playbook: playbooks/tests_ethtool_ring.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
||||
- networkmanager_version is version('1.25.2', '>=')
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
# vars:
|
||||
# - type: tap
|
||||
# - interface: tap1298
|
||||
# when: ansible_distribution_major_version > 6
|
||||
# when: ansible_facts['distribution_major_version'] > 6
|
||||
# # ip tuntap does not exist on RHEL6
|
||||
# # FIXME: Maybe use some other tool to manage devices, openvpn can do
|
||||
# # this, but it is in EPEL
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_ignore_auto_dns.yml'
|
||||
import_playbook: playbooks/tests_ignore_auto_dns.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_infiniband.yml'
|
||||
import_playbook: playbooks/tests_infiniband.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/integration_pytest_python3.yml'
|
||||
import_playbook: playbooks/integration_pytest_python3.yml
|
||||
when: (ansible_distribution in ["CentOS", "RedHat"] and
|
||||
ansible_distribution_major_version == "8") or
|
||||
(ansible_distribution == "Fedora" and
|
||||
ansible_distribution_major_version | int < 39)
|
||||
when: (ansible_facts["distribution"] in ["CentOS", "RedHat"] and
|
||||
ansible_facts["distribution_major_version"] == "8") or
|
||||
(ansible_facts["distribution"] == "Fedora" and
|
||||
ansible_facts["distribution_major_version"] | int < 39)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_ipv6_disabled.yml'
|
||||
import_playbook: playbooks/tests_ipv6_disabled.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_ipv6_dns_search.yml'
|
||||
import_playbook: playbooks/tests_ipv6_dns_search.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_ipv6.yml'
|
||||
import_playbook: playbooks/tests_ipv6.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_ipv6.yml'
|
||||
import_playbook: playbooks/tests_ipv6.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -40,6 +40,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_mac_address_match.yml'
|
||||
import_playbook: playbooks/tests_mac_address_match.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
||||
- networkmanager_version is version('1.18.0', '>=')
|
||||
|
|
|
|||
|
|
@ -20,5 +20,5 @@
|
|||
- name: Import the playbook 'playbooks/tests_network_state.yml'
|
||||
import_playbook: playbooks/tests_network_state.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_distribution_major_version | int > 7
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- ansible_facts['distribution_major_version'] | int > 7
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -40,10 +40,10 @@
|
|||
- name: Import the playbook 'playbooks/tests_provider.yml'
|
||||
import_playbook: playbooks/tests_provider.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
||||
- networkmanager_version is version('1.20.0', '>=')
|
||||
- (ansible_distribution == 'Fedora'
|
||||
and ansible_distribution_major_version | int < 41)
|
||||
or ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']
|
||||
or ansible_distribution_major_version | int < 9
|
||||
- (ansible_facts['distribution'] == 'Fedora'
|
||||
and ansible_facts['distribution_major_version'] | int < 41)
|
||||
or ansible_facts['distribution'] not in ['RedHat', 'CentOS', 'Fedora']
|
||||
or ansible_facts['distribution_major_version'] | int < 9
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_reapply.yml'
|
||||
import_playbook: playbooks/tests_reapply.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@
|
|||
- name: Import the playbook 'playbooks/tests_checkpoint_cleanup.yml'
|
||||
import_playbook: playbooks/tests_checkpoint_cleanup.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
# The test depends on behavior that is only visible with newer NM
|
||||
- networkmanager_version is version('1.22.0', '>=')
|
||||
- ansible_distribution not in ['RedHat', 'CentOS', 'Fedora'] or
|
||||
(ansible_distribution == 'Fedora' and
|
||||
ansible_distribution_major_version | int < 41) or
|
||||
ansible_distribution_major_version | int < 9
|
||||
- ansible_facts['distribution'] not in ['RedHat', 'CentOS', 'Fedora'] or
|
||||
(ansible_facts['distribution'] == 'Fedora' and
|
||||
ansible_facts['distribution_major_version'] | int < 41) or
|
||||
ansible_facts['distribution_major_version'] | int < 9
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_route_device.yml'
|
||||
import_playbook: playbooks/tests_route_device.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_route_device.yml'
|
||||
import_playbook: playbooks/tests_route_device.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_route_table.yml'
|
||||
import_playbook: playbooks/tests_route_table.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
- name: Install NetworkManager and get NetworkManager version
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
|
|
@ -40,6 +40,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_route_type.yml'
|
||||
import_playbook: playbooks/tests_route_type.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
||||
- networkmanager_version is version('1.36.0', '>=')
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_routing_rules.yml'
|
||||
import_playbook: playbooks/tests_routing_rules.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_states.yml'
|
||||
import_playbook: playbooks/tests_states.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_states.yml'
|
||||
import_playbook: playbooks/tests_states.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@
|
|||
when:
|
||||
# The test requires NetworkManager and initscripts, therefore it can only
|
||||
# run on RHEL/CentOS 7, RHEL/CentOS 8, or Fedora
|
||||
- ansible_distribution in ['CentOS', 'RedHat'] and
|
||||
ansible_distribution_major_version in ['7', '8']
|
||||
- ansible_facts['distribution'] in ['CentOS', 'RedHat'] and
|
||||
ansible_facts['distribution_major_version'] in ['7', '8']
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_team.yml'
|
||||
import_playbook: playbooks/tests_team.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_distribution not in ['RedHat', 'CentOS'] or
|
||||
ansible_distribution_major_version | int < 10
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- ansible_facts['distribution'] not in ['RedHat', 'CentOS'] or
|
||||
ansible_facts['distribution_major_version'] | int < 10
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_team_plugin_installation.yml'
|
||||
import_playbook: playbooks/tests_team_plugin_installation.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_distribution not in ['RedHat', 'CentOS'] or
|
||||
ansible_distribution_major_version | int < 10
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- ansible_facts['distribution'] not in ['RedHat', 'CentOS'] or
|
||||
ansible_facts['distribution_major_version'] | int < 10
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@
|
|||
environment:
|
||||
PYTHONPATH: "{{ _lsr_python_path }}"
|
||||
when: >
|
||||
python2_available is succeeded and ansible_distribution != 'Fedora'
|
||||
python2_available is succeeded and ansible_facts['distribution'] != 'Fedora'
|
||||
register: python2_result
|
||||
changed_when: false
|
||||
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
- name: Import the playbook 'playbooks/tests_vlan_mtu.yml'
|
||||
import_playbook: playbooks/tests_vlan_mtu.yml
|
||||
when: (ansible_distribution in ['CentOS','RedHat'] and
|
||||
ansible_distribution_major_version | int < 9)
|
||||
when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and
|
||||
ansible_facts['distribution_major_version'] | int < 9)
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_vlan_mtu.yml'
|
||||
import_playbook: playbooks/tests_vlan_mtu.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_wireless_and_network_restart.yml'
|
||||
import_playbook: playbooks/tests_wireless_and_network_restart.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -20,5 +20,5 @@
|
|||
- name: Import the playbook 'playbooks/tests_wireless.yml'
|
||||
import_playbook: playbooks/tests_wireless.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_distribution_major_version == '7'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- ansible_facts['distribution_major_version'] == '7'
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
- name: Import the playbook 'playbooks/tests_wireless_plugin_installation.yml'
|
||||
import_playbook: playbooks/tests_wireless_plugin_installation.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@
|
|||
- name: Import the playbook 'playbooks/tests_wireless_wpa3_owe.yml'
|
||||
import_playbook: playbooks/tests_wireless_wpa3_owe.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_distribution_major_version > '7' and ansible_distribution == 'CentOS' or
|
||||
ansible_distribution_major_version > '32' and ansible_distribution == 'Fedora'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- ansible_facts['distribution_major_version'] > '7' and ansible_facts['distribution'] == 'CentOS' or
|
||||
ansible_facts['distribution_major_version'] > '32' and ansible_facts['distribution'] == 'Fedora'
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@
|
|||
- name: Import the playbook 'playbooks/tests_wireless_wpa3_sae.yml'
|
||||
import_playbook: playbooks/tests_wireless_wpa3_sae.yml
|
||||
when:
|
||||
- ansible_distribution_major_version != '6'
|
||||
- ansible_distribution_major_version != '7' and ansible_distribution != 'RedHat'
|
||||
- ansible_facts['distribution_major_version'] != '6'
|
||||
- ansible_facts['distribution_major_version'] != '7' and ansible_facts['distribution'] != 'RedHat'
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ __network_rh_distros:
|
|||
__network_rh_distros_fedora: "{{ __network_rh_distros + ['Fedora'] }}"
|
||||
|
||||
# Use this in conditionals to check if distro is Red Hat or clone
|
||||
__network_is_rh_distro: "{{ ansible_distribution in __network_rh_distros }}"
|
||||
__network_is_rh_distro: "{{ ansible_facts['distribution'] in __network_rh_distros }}"
|
||||
|
||||
# Use this in conditionals to check if distro is Red Hat or clone, or Fedora
|
||||
__network_is_rh_distro_fedora: "{{ ansible_distribution in __network_rh_distros_fedora }}"
|
||||
__network_is_rh_distro_fedora: "{{ ansible_facts['distribution'] in __network_rh_distros_fedora }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue