From 6229b3bdba6fd12ebdeef5fec6f4715f0bb48d23 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 11 Mar 2021 08:43:53 -0700 Subject: [PATCH] Disable facts by default in ansible.cfg As a continuation of a7f2fa73e63e69dba2e41aaac9732397eec437c9, this change switches fact injection to off by default in the provided ansible.cfg. Signed-off-by: Alex Schultz (cherry picked from commit db031a4993480ca987011630fa716f7e2ccda976) --- ansible.cfg | 1 + roles/ceph-facts/tasks/facts.yml | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/ansible.cfg b/ansible.cfg index c579a576b..ba8d50e67 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -21,6 +21,7 @@ nocows = 1 callback_whitelist = profile_tasks stdout_callback = yaml force_valid_group_names = ignore +inject_facts_as_vars = False # Disable them in the context of https://review.openstack.org/#/c/469644 retry_files_enabled = False diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index a288b82ac..d968c0c99 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -23,6 +23,16 @@ discovered_interpreter_python: "{{ ansible_python_interpreter }}" when: ansible_python_interpreter is defined +# If ansible_python_interpreter is not defined, this can result in the +# discovered_interpreter_python fact from being set. This fails later in this +# playbook and is used elsewhere. +- name: set_fact discovered_interpreter_python if not previously set + set_fact: + discovered_interpreter_python: "{{ ansible_facts['discovered_interpreter_python'] }}" + when: + - discovered_interpreter_python is not defined + - ansible_facts['discovered_interpreter_python'] is defined + # Set ceph_release to ceph_stable by default - name: set_fact ceph_release ceph_stable_release set_fact: