2017-09-23 03:19:50 +00:00
.. contents :: Topics
Cache Plugins
-------------
2017-09-25 22:37:33 +00:00
Cache plugin implement a backend caching mechanism that allows Ansible to store gathered facts or inventory source data
without the performance hit of retrieving them from source.
2017-09-23 03:19:50 +00:00
2017-09-25 22:37:33 +00:00
The default cache plugin is the :doc: `memory <cache/memory>` plugin, which only caches the data for the current execution of Ansible. Other plugins with persistent storage are available to allow caching the data across runs.
2017-09-23 03:19:50 +00:00
2017-10-11 04:15:25 +00:00
.. _enabling_cache:
2017-09-23 03:19:50 +00:00
Enabling Cache Plugins
++++++++++++++++++++++
Only one cache plugin can be active at a time.
2017-09-25 22:37:33 +00:00
You can enable a cache plugin in the Ansible configuration, either via environment variable:
2017-09-23 03:19:50 +00:00
.. code-block :: shell
export ANSIBLE_CACHE_PLUGIN=jsonfile
or in the `` ansible.cfg `` file:
.. code-block :: ini
[defaults]
fact_caching=redis
2017-09-25 22:37:33 +00:00
You will also need to configure other settings specific to each plugin. Consult the individual plugin documentation
2018-04-20 00:02:30 +00:00
or the Ansible :ref: `configuration <ansible_configuration_settings>` for more details.
2017-09-23 03:19:50 +00:00
2018-04-20 00:02:30 +00:00
A custom cache plugin is enabled by dropping it into a `` cache_plugins `` directory adjacent to your play, inside a role, or by putting it in one of the directory sources configured in :ref: `ansible.cfg <ansible_configuration_settings>` .
2017-10-11 04:15:25 +00:00
.. _using_cache:
Using Cache Plugins
+++++++++++++++++++
2017-10-15 16:21:59 +00:00
Cache plugins are used automatically once they are enabled.
2017-10-11 04:15:25 +00:00
.. _cache_plugin_list:
2017-09-23 03:19:50 +00:00
Plugin List
+++++++++++
2017-10-11 04:15:25 +00:00
You can use `` ansible-doc -t cache -l `` to see the list of available plugins.
2017-09-25 22:37:33 +00:00
Use `` ansible-doc -t cache <plugin name> `` to see specific documentation and examples.
2017-09-23 03:19:50 +00:00
.. toctree :: :maxdepth: 1
:glob:
cache/*
.. seealso ::
:doc: `action`
Ansible Action plugins
:doc: `callback`
Ansible callback plugins
:doc: `connection`
Ansible connection plugins
:doc: `inventory`
Ansible inventory plugins
:doc: `shell`
Ansible Shell plugins
:doc: `strategy`
Ansible Strategy plugins
:doc: `vars`
Ansible Vars plugins
2017-10-15 16:21:59 +00:00
`User Mailing List <https://groups.google.com/forum/#!forum/ansible-devel> `_
2017-09-23 03:19:50 +00:00
Have a question? Stop by the google group!
2017-10-15 16:21:59 +00:00
`webchat.freenode.net <https://webchat.freenode.net> `_
2017-09-23 03:19:50 +00:00
#ansible IRC chat channel