From 957a78a12e256d3586edc671aaa7f29ce799addc Mon Sep 17 00:00:00 2001 From: Miroslav Vadkerti Date: Mar 18 2022 20:55:16 +0000 Subject: Use /usr/libexec/platform-python in case of RHEL-8 While trying to get working STR against a Beaker machine for @omajid we found this problem. Python3 is not available in the default installation of RHEL-8. In BaseOS CI we default there to `/usr/libexec/platform-python` which works well. After investigating the problem, these changes seem to fix the problem also in this environment. /usr/libexec/platform-python is system Python-3.6.8 Signed-off-by: Miroslav Vadkerti --- diff --git a/roles/str-common-init/tasks/inspect.yml b/roles/str-common-init/tasks/inspect.yml index 81e0dba..b90a4d9 100644 --- a/roles/str-common-init/tasks/inspect.yml +++ b/roles/str-common-init/tasks/inspect.yml @@ -29,5 +29,10 @@ # Make sure to use python3 when running on RHEL8 and Fedora distributions. - name: Hardcode Python 3 interpreter for ansible modules set_fact: + ansible_python_interpreter: /usr/libexec/platform-python + when: is_rhel8_based + +- name: Hardcode Python 3 interpreter for ansible modules + set_fact: ansible_python_interpreter: /usr/bin/env python3 - when: is_rhel8_based or distro_name == 'fedora' + when: distro_name == 'fedora' diff --git a/roles/str-common-init/tasks/trunner.yml b/roles/str-common-init/tasks/trunner.yml index 1e7966f..9d6c06e 100644 --- a/roles/str-common-init/tasks/trunner.yml +++ b/roles/str-common-init/tasks/trunner.yml @@ -52,7 +52,7 @@ - name: Hardcode Python 3 interpreter for ansible modules for test-runner delegate_facts: True set_fact: - ansible_python_interpreter: /usr/bin/env python3 + ansible_python_interpreter: /usr/libexec/platform-python when: "hostvars[test_runner_inventory_name]['is_rhel8_based'] | bool" - name: Fetch tests from remote repositories diff --git a/roles/str-common-pkgs/tasks/inspect.yml b/roles/str-common-pkgs/tasks/inspect.yml index 395dc3f..949bd84 100644 --- a/roles/str-common-pkgs/tasks/inspect.yml +++ b/roles/str-common-pkgs/tasks/inspect.yml @@ -31,5 +31,5 @@ # This can be removed once RHEL8 uses by default Python3 - name: Hardcode Python 3 interpreter for ansible modules set_fact: - ansible_python_interpreter: /usr/bin/env python3 + ansible_python_interpreter: /usr/libexec/platform-python when: is_rhel8_based