From 3bfa1c50dee656cd31936e47d1d0fa5c305be3ee Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Thu, 22 Aug 2019 17:46:05 +0200 Subject: [PATCH] set discovered_python_interpreter if ansible_python_interpreter is defined If the user has set the `ansible_python_interpreter`, ansible will not try to discover python, so `discovered_python_interpreter` will not be set. Solution: Set `discovered_python_interpreter` to `ansible_python_interpreter` if `ansible_python_interpreter` is defined Signed-off-by: Johannes Kastl (cherry picked from commit bd507fa14751398e1248a630fec2262b1540702b) --- roles/ceph-facts/tasks/facts.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 8658f775c..86f9a21ef 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -21,6 +21,14 @@ set_fact: container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_distribution == 'Fedora') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8') else 'docker' }}" +# In case ansible_python_interpreter is set by the user, +# ansible will not discover python and discovered_python_interpreter +# will not be set +- name: set_fact discovered_python_interpreter + set_fact: + discovered_python_interpreter: ansible_python_interpreter + when: ansible_python_interpreter is defined + # Set ceph_release to ceph_stable by default - name: set_fact ceph_release ceph_stable_release set_fact: