You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The repository contains Ansible playbooks that gather and utilize facts but do not specify a persistent cache plugin in the ansible.cfg file. By default, the memory cache plugin is used, which only retains data during the current execution of Ansible and does not persist across runs. Without fact caching setup, it shows low performance due to repeated fact gathering and increased memory consumption during long or complex playbook executions. The absence of a persistent cache plugin impacts scalability and efficiency, especially when working with large inventories or multiple playbook runs.
Expected Behavior
The request is to either add the below suggested in your repo delivered ansible.cfg files or make a strong recommendation for users to update it as such.
An appropriate cache plugin should be configured in ansible.cfg to persist facts across Ansible runs. Plugins such as jsonfile, redis, or yaml can be used to store facts persistently, reducing repeated fact gathering, improving performance, and minimizing memory consumption.
Expected example configuration in ansible.cfg:
fact_caching = jsonfile
fact_caching_connection = /path/to/fact_cache
fact_caching_timeout = 7200
Actual Behavior
performance impact due to no persistent fact caching plugin used
Environment
CentOS stream 9
The text was updated successfully, but these errors were encountered:
Those settings alone won't have any effect because the default value of DEFAULT_GATHERING is set to implicit which ignores caches, i.e. facts would still be gathered unless in the playbook gather_facts is set to false (and in this case the existence of a cache doesn't matter, too).
And changing DEFAULT_GATHERING to either explicit or smart is opening a can of worms unless all your playbooks and roles are designed that way. Otherwise they might take actions based on outdated facts leading to potentially undesired results.
IMHO this a performance optimization which someone can do locally in a controlled environment where he/she is fully aware of this change by opting in, but changing the default behaviour of Ansible without notice sounds questionable to me. In my opinion, a default should never sacrifice robustness/expected behavior over execution time.
FWIW, if using those settings, I would prefer Ansible's FQCN naming schema, hence
Description
The repository contains Ansible playbooks that gather and utilize facts but do not specify a persistent cache plugin in the ansible.cfg file. By default, the memory cache plugin is used, which only retains data during the current execution of Ansible and does not persist across runs. Without fact caching setup, it shows low performance due to repeated fact gathering and increased memory consumption during long or complex playbook executions. The absence of a persistent cache plugin impacts scalability and efficiency, especially when working with large inventories or multiple playbook runs.
Expected Behavior
The request is to either add the below suggested in your repo delivered ansible.cfg files or make a strong recommendation for users to update it as such.
An appropriate cache plugin should be configured in ansible.cfg to persist facts across Ansible runs. Plugins such as jsonfile, redis, or yaml can be used to store facts persistently, reducing repeated fact gathering, improving performance, and minimizing memory consumption.
Expected example configuration in ansible.cfg:
fact_caching = jsonfile
fact_caching_connection = /path/to/fact_cache
fact_caching_timeout = 7200
Actual Behavior
performance impact due to no persistent fact caching plugin used
Environment
CentOS stream 9
The text was updated successfully, but these errors were encountered: