diff --git a/releasenotes/notes/ansible-fact-subset-08e582fcf7ba4e4e.yaml b/releasenotes/notes/ansible-fact-subset-08e582fcf7ba4e4e.yaml new file mode 100644 index 0000000000..6e414d7f66 --- /dev/null +++ b/releasenotes/notes/ansible-fact-subset-08e582fcf7ba4e4e.yaml @@ -0,0 +1,13 @@ +--- +features: + - In order to reduce the time taken for fact gathering, the default + subset gathered has been reduced to a smaller set than the Ansible + default. This may be changed by the deployer by setting the + ``ANSIBLE_GATHER_SUBSET`` variable in the bash environment prior + to executing any ansible commands. +upgrade: + - In order to reduce the time taken for fact gathering, the default + subset gathered has been reduced to a smaller set than the Ansible + default. This may be changed by the deployer by setting the + ``ANSIBLE_GATHER_SUBSET`` variable in the bash environment prior + to executing any ansible commands. diff --git a/scripts/openstack-ansible.rc b/scripts/openstack-ansible.rc index 48de6fcf44..cd02a6b6b7 100644 --- a/scripts/openstack-ansible.rc +++ b/scripts/openstack-ansible.rc @@ -26,6 +26,8 @@ export ANSIBLE_ACTION_PLUGINS="${ANSIBLE_ACTION_PLUGINS:-/etc/ansible/roles/plug export ANSIBLE_CALLBACK_PLUGINS="${ANSIBLE_CALLBACK_PLUGINS:-/etc/ansible/roles/plugins/callback}" export ANSIBLE_GATHERING="${ANSIBLE_GATHERING:-smart}" +export ANSIBLE_GATHER_SUBSET="${ANSIBLE_GATHER_SUBSET:-network,hardware,virtual}" + export ANSIBLE_CACHE_PLUGIN="${ANSIBLE_CACHE_PLUGIN:-jsonfile}" export ANSIBLE_CACHE_PLUGIN_CONNECTION="${ANSIBLE_CACHE_PLUGIN_CONNECTION:-/etc/openstack_deploy/ansible_facts}" export ANSIBLE_CACHE_PLUGIN_TIMEOUT="${ANSIBLE_CACHE_PLUGIN_TIMEOUT:-86400}" diff --git a/scripts/run-playbooks.sh b/scripts/run-playbooks.sh index 01184132e2..8130b182c7 100755 --- a/scripts/run-playbooks.sh +++ b/scripts/run-playbooks.sh @@ -49,14 +49,14 @@ function playbook_run { # First we gather facts about the hosts to populate the fact cache. # We can't gather the facts for all hosts yet because the containers # aren't built yet. - ansible -m setup -a "gather_subset=!facter,!ohai" hosts + ansible -m setup -a "gather_subset=network,hardware,virtual" hosts for root_include in $(awk -F'include:' '{print $2}' setup-everything.yml); do # Once setup-hosts is complete, we should gather facts for everything # (now including containers) so that the fact cache is complete for the # remainder of the run. if [[ "${root_include}" == "setup-infrastructure.yml" ]]; then - ansible -m setup -a "gather_subset=!facter,!ohai" all + ansible -m setup -a "gather_subset=network,hardware,virtual" all fi for include in $(awk -F'include:' '{print $2}' "${root_include}"); do echo "[Executing \"${include}\" playbook]"