]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Disable facts by default in ansible.cfg
authorAlex Schultz <aschultz@redhat.com>
Thu, 11 Mar 2021 15:43:53 +0000 (08:43 -0700)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 25 Mar 2021 23:05:33 +0000 (00:05 +0100)
As a continuation of a7f2fa73e63e69dba2e41aaac9732397eec437c9, this
change switches fact injection to off by default in the provided
ansible.cfg.

Signed-off-by: Alex Schultz <aschultz@redhat.com>
(cherry picked from commit db031a4993480ca987011630fa716f7e2ccda976)
(cherry picked from commit 5fa4ff5ed36e9df3215e54cb55ddc6e9905f486c)

ansible.cfg
roles/ceph-facts/tasks/facts.yml

index c579a576b41be9af1ae186d26b005f59e0db06f3..ba8d50e678af9610ad1d95299d328b3c82e9b331 100644 (file)
@@ -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
index 370a6e09c28103578af46abd2fec0ad2b769a461..364dd10b1252ccd49aee5fcabf731bdbc4da4e7d 100644 (file)
     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: