aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/source/user/ansible-tuning.rst19
-rw-r--r--doc/source/user/operating-kolla.rst3
-rw-r--r--releasenotes/notes/gather-facts-command-7b62d2c3eb13ec8e.yaml5
-rwxr-xr-xtools/kolla-ansible6
4 files changed, 33 insertions, 0 deletions
diff --git a/doc/source/user/ansible-tuning.rst b/doc/source/user/ansible-tuning.rst
index e8f39ac0c..019dddedd 100644
--- a/doc/source/user/ansible-tuning.rst
+++ b/doc/source/user/ansible-tuning.rst
@@ -65,6 +65,25 @@ the `jsonfile cache plugin
You may also wish to set the expiration timeout for the cache via ``[defaults]
fact_caching_timeout``.
+Populating the cache
+~~~~~~~~~~~~~~~~~~~~
+
+In some situations it may be helpful to populate the fact cache on demand. The
+``kolla-ansible gather-facts`` command may be used to do this.
+
+One specific case where this may be helpful is when running ``kolla-ansible``
+with a ``--limit`` argument, since in that case hosts that match the limit will
+gather facts for hosts that fall outside the limit. In the extreme case of a
+limit that matches only one host, it will serially gather facts for all other
+hosts. To avoid this issue, run ``kolla-ansible gather-facts`` without a limit
+to populate the fact cache in parallel before running the required command with
+a limit. For example:
+
+.. code-block:: console
+
+ kolla-ansible gather-facts
+ kolla-ansible deploy --limit control01
+
Fact variable injection
-----------------------
diff --git a/doc/source/user/operating-kolla.rst b/doc/source/user/operating-kolla.rst
index 5c3ed3b12..98543a728 100644
--- a/doc/source/user/operating-kolla.rst
+++ b/doc/source/user/operating-kolla.rst
@@ -207,6 +207,9 @@ times. This can be useful to share configuration between multiple environments.
Any common configuration can be set in ``INVENTORY1`` and ``INVENTORY2`` can be
used to set environment specific details.
+``kolla-ansible -i INVENTORY gather-facts`` is used to gather Ansible facts,
+for example to populate a fact cache.
+
.. note::
In order to do smoke tests, requires ``kolla_enable_sanity_checks=yes``.
diff --git a/releasenotes/notes/gather-facts-command-7b62d2c3eb13ec8e.yaml b/releasenotes/notes/gather-facts-command-7b62d2c3eb13ec8e.yaml
new file mode 100644
index 000000000..8f8a5c847
--- /dev/null
+++ b/releasenotes/notes/gather-facts-command-7b62d2c3eb13ec8e.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - |
+ Adds a ``kolla-ansible gather-facts`` command that may be used to gather
+ Ansible host facts.
diff --git a/tools/kolla-ansible b/tools/kolla-ansible
index a6d222b7a..208be612c 100755
--- a/tools/kolla-ansible
+++ b/tools/kolla-ansible
@@ -161,6 +161,7 @@ Commands:
deploy-bifrost Deploy and start bifrost container
deploy-servers Enroll and deploy servers with bifrost
deploy-containers Only deploy and start containers (no config updates or bootstrapping)
+ gather-facts Gather Ansible facts
post-deploy Do post deploy on deploy node
pull Pull all images for containers (only pulls, no running container changes)
reconfigure Reconfigure OpenStack service
@@ -203,6 +204,7 @@ deploy
deploy-bifrost
deploy-containers
deploy-servers
+gather-facts
post-deploy
pull
reconfigure
@@ -429,6 +431,10 @@ EOF
PLAYBOOK="${BASEDIR}/ansible/bifrost.yml"
EXTRA_OPTS="$EXTRA_OPTS -e kolla_action=deploy-servers"
;;
+(gather-facts)
+ ACTION="Gathering Ansible facts"
+ PLAYBOOK="${BASEDIR}/ansible/gather-facts.yml"
+ ;;
(post-deploy)
ACTION="Post-Deploying Playbooks"
PLAYBOOK="${BASEDIR}/ansible/post-deploy.yml"