The Ansible master playbook of the Kolla project is big and consists of a lot of playbooks. The fact gathering before each call of a playbook requires time. The required time depends on the size of the environment and is possibly not negligible.

Fact Caching, introduced in Ansible 1.8, helps avoid the side effects of excessive coffee consumption while waiting for the execution of actions. Ansible ships with two cache plugins: JSON and Redis. The following example highlights the Redis configuration.

Configuring Fact Caching

To set up Redis fact caching, proceed as follows on the Kolla deployment host.

  1. Start a Redis container:
  2. Install the Python client for Redis:
  3. Add the following code to the Ansible configuration file, e.g. /etc/ansible/ansible.cfg:

Testing Fact Caching

Use the following playbook for a quick test:

Save the playbook to testing.yml and run it with the inventory file of the Kolla environment. The execution time should be fairly short, once the facts have been initially cached prior to the first run.