Configuring fact caching in Ansible
Fact caching is an important feature that can help you optimize and speed up the execution time of your playbooks when you require facts to be collected, for example, from your infrastructure.
Ansible is a powerful tool to collect information about the operational state of our infrastructure, and we can use this information to generate configurations, build reports, and also validate the state of our infrastructure. In cases where the state of our infrastructure is highly stable, we might not need to collect network facts from our devices during every playbook run. In such cases, we might opt to use fact caching to speed up the execution of our playbooks. Once facts have been gathered, the next time we read the facts (network state) of our devices, we will get them from a stored location on the Ansible control node, instead of connecting to the devices and collecting information from the live network.
Aside from the speed savings, there...