]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
common: make the delegate_facts feature optional
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 31 Oct 2017 13:39:29 +0000 (14:39 +0100)
committerSébastien Han <seb@redhat.com>
Thu, 10 May 2018 17:43:37 +0000 (10:43 -0700)
Since we encountered issue with this on ansible2.2, this commit provide
the ability to enable or disable it regarding which ansible we are
running.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 4596fbaac1322a4c670026bc018e3b5b061b072b)

site.yml.sample
tox.ini

index f8c3ddf86c74fe6102d71388043b7244aaf47001..4904e512b40db0e4270de32bc87ea1d69047b1f7 100644 (file)
@@ -19,6 +19,9 @@
   tags:
     - always
 
+  vars:
+    delegate_facts_host: True
+
   tasks:
     # If we can't get python2 installed before any module is used we will fail
     # so just try what we can to get it installed
       when:
         - systempython2.stat.exists is undefined or systempython2.stat.exists == false
 
+    - name: gather facts
+      setup:
+      when:
+        - not delegate_facts_host | bool
+
     - name: gather and delegate facts
       setup:
       delegate_to: "{{ item }}"
diff --git a/tox.ini b/tox.ini
index ede77284c9ee3fbd3a8657b5b6c33590d5c0f0b8..31616d0588fd9be0f3628eb1350cb627754c3399 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -126,6 +126,7 @@ setenv=
   ANSIBLE_ACTION_PLUGINS = {toxinidir}/plugins/actions
   # only available for ansible >= 2.2
   ANSIBLE_STDOUT_CALLBACK = debug
+  ansible2.2: DELEGATE_FACTS_HOST = False
   docker_cluster: PLAYBOOK = site-docker.yml.sample
   docker_cluster_collocation: PLAYBOOK = site-docker.yml.sample
   ooo_collocation: PLAYBOOK = site-docker.yml.sample
@@ -204,6 +205,7 @@ commands=
   rhcs: ansible-playbook -vv -i {changedir}/hosts {toxinidir}/tests/functional/rhcs_setup.yml --extra-vars "ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} repo_url={env:REPO_URL:} rhel7_repo_url={env:RHEL7_REPO_URL:}" --skip-tags "vagrant_setup"
 
   ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
+      delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
       fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
       ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
       ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
@@ -231,6 +233,7 @@ commands=
   # handlers/idempotency test
   ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} \
       --extra-vars "\
+      delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
       fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
       ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
       ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \