| |
@@ -16,6 +16,23 @@
|
| |
{{ hostvars[test_runner_inventory_name]['ansible_pkg_mgr'] == 'yum' }}
|
| |
is_dnf_os: >
|
| |
{{ hostvars[test_runner_inventory_name]['ansible_pkg_mgr'] == 'dnf' }}
|
| |
+ is_rhel8_based: >
|
| |
+ {{
|
| |
+ ( [hostvars[test_runner_inventory_name]['ansible_distribution']] |
|
| |
+ intersect(['RedHat', 'CentOS']) | bool )
|
| |
+ and
|
| |
+ ( hostvars[test_runner_inventory_name]['ansible_distribution_version'] |
|
| |
+ int == 8 )
|
| |
+ }}
|
| |
+
|
| |
+ # Fix python ansible interpreter when running on RHEL8. Currently RHEL8
|
| |
+ # uses python2, but it does miss some python2 modules, such as python2-dnf.
|
| |
+ # This can be removed once RHEL8 uses by default Python 3.
|
| |
+ - name: Hardcode Python interpreter for ansible modules on RHEL8 based OS
|
| |
+ delegate_facts: True
|
| |
+ set_fact:
|
| |
+ ansible_python_interpreter: /usr/bin/env python3
|
| |
+ when: "hostvars[test_runner_inventory_name]['is_rhel8_based'] | bool"
|
| |
|
| |
- name: Fetch tests from remote repositories
|
| |
git:
|
| |
@@ -43,3 +60,9 @@
|
| |
{{ test_runner_inventory_name }} uses dnf:
|
| |
{{ hostvars[test_runner_inventory_name]['is_dnf_os'] }}
|
| |
verbosity: 1
|
| |
+
|
| |
+ - debug:
|
| |
+ msg: >
|
| |
+ {{ test_runner_inventory_name }} is RHEL8 based OS:
|
| |
+ {{ hostvars[test_runner_inventory_name]['is_rhel8_based'] }}
|
| |
+ verbosity: 1
|
| |
Patch to address: https://pagure.io/standard-test-roles/issue/120