From 272b4d1899eca90450dcab1322739fdc3180b7e5 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 31 Oct 2017 14:39:29 +0100 Subject: [PATCH] common: make the delegate_facts feature optional 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 (cherry picked from commit 4596fbaac1322a4c670026bc018e3b5b061b072b) --- site.yml.sample | 8 ++++++++ tox.ini | 3 +++ 2 files changed, 11 insertions(+) diff --git a/site.yml.sample b/site.yml.sample index f8c3ddf86..4904e512b 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -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 @@ -40,6 +43,11 @@ 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 ede77284c..31616d058 100644 --- 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} \ -- 2.39.5