ansible.plugins.cache package

class ansible.plugins.cache.FactCache(*args, **kwargs)[source]

Bases: _abcoll.MutableMapping

copy()[source]

Return a primitive copy of the keys and values from the cache.

keys()[source]
flush()[source]

Flush the fact cache of all keys.

update(key, value)[source]

Submodules

ansible.plugins.cache.base module

class ansible.plugins.cache.base.BaseCacheModule[source]

Bases: object

get(key)[source]
set(key, value)[source]
keys()[source]
contains(key)[source]
delete(key)[source]
flush()[source]
copy()[source]

ansible.plugins.cache.jsonfile module

class ansible.plugins.cache.jsonfile.CacheModule(*args, **kwargs)[source]

Bases: ansible.plugins.cache.base.BaseCacheModule

A caching module backed by json files.

get(key)[source]

This checks the in memory cache first as the fact was not expired at ‘gather time’ and it would be problematic if the key did expire after some long running tasks and user gets ‘undefined’ error in the same play

set(key, value)[source]
has_expired(key)[source]
keys()[source]
contains(key)[source]
delete(key)[source]
flush()[source]
copy()[source]

ansible.plugins.cache.memcached module

ansible.plugins.cache.memory module

class ansible.plugins.cache.memory.CacheModule(*args, **kwargs)[source]

Bases: ansible.plugins.cache.base.BaseCacheModule

get(key)[source]
set(key, value)[source]
keys()[source]
contains(key)[source]
delete(key)[source]
flush()[source]
copy()[source]

ansible.plugins.cache.redis module

class ansible.plugins.cache.redis.CacheModule(*args, **kwargs)[source]

Bases: ansible.plugins.cache.base.BaseCacheModule

A caching module backed by redis.

Keys are maintained in a zset with their score being the timestamp when they are inserted. This allows for the usage of ‘zremrangebyscore’ to expire keys. This mechanism is used or a pattern matched ‘scan’ for performance.

get(key)[source]
set(key, value)[source]
keys()[source]
contains(key)[source]
delete(key)[source]
flush()[source]
copy()[source]