|
12 | 12 | GET_NM_VERSION = """ |
13 | 13 | - name: Install NetworkManager and get NetworkManager version |
14 | 14 | when: |
15 | | - - ansible_distribution_major_version != '6' |
| 15 | + - ansible_facts['distribution_major_version'] != '6' |
16 | 16 | tags: |
17 | 17 | - always |
18 | 18 | block: |
|
58 | 58 | {comment}- name: Import the playbook '{test_playbook}' |
59 | 59 | import_playbook: {test_playbook} |
60 | 60 | when: |
61 | | - - ansible_distribution_major_version != '6' |
| 61 | + - ansible_facts['distribution_major_version'] != '6' |
62 | 62 | {minimum_nm_version_check}{extra_run_condition}""" |
63 | 63 |
|
64 | 64 | MINIMUM_VERSION = "minimum_version" |
65 | 65 | EXTRA_RUN_CONDITION = "extra_run_condition" |
66 | 66 | NM_ONLY_TESTS = { |
67 | 67 | "playbooks/tests_802_1x_updated.yml": { |
68 | 68 | EXTRA_RUN_CONDITION: ( |
69 | | - "(ansible_distribution != 'RedHat' and\n" |
70 | | - " ansible_distribution_major_version | int > 7) or\n" |
71 | | - " ansible_distribution_major_version | int == 8" |
| 69 | + "(ansible_facts['distribution'] != 'RedHat' and\n" |
| 70 | + " ansible_facts['distribution_major_version'] | int > 7) or\n" |
| 71 | + " ansible_facts['distribution_major_version'] | int == 8" |
72 | 72 | ), |
73 | 73 | }, |
74 | 74 | "playbooks/tests_802_1x.yml": { |
75 | 75 | EXTRA_RUN_CONDITION: ( |
76 | | - "(ansible_distribution != 'RedHat' and\n" |
77 | | - " ansible_distribution_major_version | int > 7) or\n" |
78 | | - " ansible_distribution_major_version | int == 8" |
| 76 | + "(ansible_facts['distribution'] != 'RedHat' and\n" |
| 77 | + " ansible_facts['distribution_major_version'] | int > 7) or\n" |
| 78 | + " ansible_facts['distribution_major_version'] | int == 8" |
79 | 79 | ), |
80 | 80 | }, |
81 | 81 | "playbooks/tests_ignore_auto_dns.yml": {}, |
|
94 | 94 | MINIMUM_VERSION: "'1.20.0'", |
95 | 95 | "comment": "# NetworKmanager 1.20.0 added support for forgetting profiles", |
96 | 96 | EXTRA_RUN_CONDITION: ( |
97 | | - "(ansible_distribution == 'Fedora'\n" |
98 | | - " and ansible_distribution_major_version | int < 41)\n" |
99 | | - " or ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']\n" |
100 | | - " or ansible_distribution_major_version | int < 9" |
| 97 | + "(ansible_facts['distribution'] == 'Fedora'\n" |
| 98 | + " and ansible_facts['distribution_major_version'] | int < 41)\n" |
| 99 | + " or ansible_facts['distribution'] not in ['RedHat', 'CentOS', 'Fedora']\n" |
| 100 | + " or ansible_facts['distribution_major_version'] | int < 9" |
101 | 101 | ), |
102 | 102 | }, |
103 | 103 | "playbooks/tests_eth_pci_address_match.yml": { |
104 | 104 | MINIMUM_VERSION: "'1.26.0'", |
105 | 105 | "comment": "# NetworkManager 1.26.0 added support for match.path setting", |
106 | 106 | }, |
107 | 107 | "playbooks/tests_network_state.yml": { |
108 | | - EXTRA_RUN_CONDITION: "ansible_distribution_major_version | int > 7", |
| 108 | + EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] | int > 7", |
109 | 109 | }, |
110 | 110 | "playbooks/tests_reapply.yml": {}, |
111 | 111 | "playbooks/tests_route_table.yml": {}, |
|
117 | 117 | "playbooks/tests_routing_rules.yml": {}, |
118 | 118 | # teaming support dropped in EL10 |
119 | 119 | "playbooks/tests_team.yml": { |
120 | | - EXTRA_RUN_CONDITION: "ansible_distribution not in ['RedHat', 'CentOS'] or\n ansible_distr\ |
121 | | -ibution_major_version | int < 10", |
| 120 | + EXTRA_RUN_CONDITION: "ansible_facts['distribution'] not in ['RedHat', 'CentOS'] or\n ansible_facts['distribution_major_version'] | int < 10", |
122 | 121 | }, |
123 | 122 | "playbooks/tests_team_plugin_installation.yml": { |
124 | | - EXTRA_RUN_CONDITION: "ansible_distribution not in ['RedHat', 'CentOS'] or\n ansible_distr\ |
125 | | -ibution_major_version | int < 10", |
| 123 | + EXTRA_RUN_CONDITION: "ansible_facts['distribution'] not in ['RedHat', 'CentOS'] or\n ansible_facts['distribution_major_version'] | int < 10", |
126 | 124 | }, |
127 | 125 | # mac80211_hwsim (used for tests_wireless) only seems to be available |
128 | 126 | # and working on RHEL/CentOS 7 |
129 | 127 | "playbooks/tests_wireless.yml": { |
130 | | - EXTRA_RUN_CONDITION: "ansible_distribution_major_version == '7'", |
| 128 | + EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] == '7'", |
131 | 129 | }, |
132 | 130 | "playbooks/tests_wireless_and_network_restart.yml": {}, |
133 | 131 | "playbooks/tests_wireless_plugin_installation.yml": {}, |
134 | 132 | "playbooks/tests_wireless_wpa3_owe.yml": { |
135 | 133 | "comment": "# OWE has not been supported by NetworkManager 1.18.8 on \ |
136 | 134 | RHEL 7(dist-tag). Failed in setting up mock wifi on RHEL 8", |
137 | | - EXTRA_RUN_CONDITION: "ansible_distribution_major_version > '7' and \ |
138 | | -ansible_distribution == 'CentOS' or\n ansible_distribution_major_version > '32' \ |
139 | | -and ansible_distribution == 'Fedora'", |
| 135 | + EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] > '7' and \ |
| 136 | +ansible_facts['distribution'] == 'CentOS' or\n ansible_facts['distribution_major_version'] > '32' \ |
| 137 | +and ansible_facts['distribution'] == 'Fedora'", |
140 | 138 | }, |
141 | 139 | "playbooks/tests_wireless_wpa3_sae.yml": { |
142 | 140 | "comment": "# SAE has not been supported by NetworkManager 1.18.8 on \ |
143 | 141 | RHEL 7. Failed in setting up mock wifi on RHEL 8", |
144 | | - EXTRA_RUN_CONDITION: "ansible_distribution_major_version != '7' and \ |
145 | | -ansible_distribution != 'RedHat'", |
| 142 | + EXTRA_RUN_CONDITION: "ansible_facts['distribution_major_version'] != '7' and \ |
| 143 | +ansible_facts['distribution'] != 'RedHat'", |
146 | 144 | }, |
147 | 145 | } |
148 | 146 | # NM_CONDITIONAL_TESTS is used to store the test playbooks which are demanding for NM |
|
187 | 185 |
|
188 | 186 | - name: Import the playbook '{test_playbook}' |
189 | 187 | import_playbook: {test_playbook} |
190 | | - when: (ansible_distribution in ['CentOS','RedHat'] and\n \ |
191 | | -ansible_distribution_major_version | int < 9) |
| 188 | + when: (ansible_facts['distribution'] in ['CentOS','RedHat'] and\n \ |
| 189 | +ansible_facts['distribution_major_version'] | int < 9) |
192 | 190 | """ |
193 | 191 |
|
194 | 192 |
|
|
0 commit comments