Return data to a redis server
To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults:
redis.db: '0'
redis.host: 'salt'
redis.port: 6379
Alternative configuration values can be used by prefacing the configuration. Any values not found in the alternative configuration will be pulled from the default location:
alternative.redis.db: '0'
alternative.redis.host: 'salt'
alternative.redis.port: 6379
To use the redis returner, append '--return redis' to the salt command.
salt '*' test.ping --return redis
To use the alternative configuration, append '--return_config alternative' to the salt command.
New in version 2015.5.0.
salt '*' test.ping --return redis --return_config alternative
To override individual configuration items, append --return_kwargs '{"key:": "value"}' to the salt command.
New in version 2016.3.0.
salt '*' test.ping --return redis --return_kwargs '{"db": "another-salt"}'
salt.returners.redis_return.
clean_old_jobs
()¶Clean out minions's return data for old jobs.
Normally, hset 'ret:<jid>' are saved with a TTL, and will eventually get cleaned by redis.But for jobs with some very late minion return, the corresponding hset's TTL will be refreshed to a too late timestamp, we'll do manually cleaning here.
salt.returners.redis_return.
get_fun
(fun)¶Return a dict of the last function called for all minions
salt.returners.redis_return.
get_jid
(jid)¶Return the information returned when the specified job id was executed
salt.returners.redis_return.
get_jids
()¶Return a dict mapping all job ids to job information
salt.returners.redis_return.
get_load
(jid)¶Return the load data that marks a specified jid
salt.returners.redis_return.
get_minions
()¶Return a list of minions
salt.returners.redis_return.
prep_jid
(nocache=False, passed_jid=None)¶Do any work necessary to prepare a JID, including sending a custom id
salt.returners.redis_return.
returner
(ret)¶Return data to a redis data store
salt.returners.redis_return.
save_load
(jid, load, minions=None)¶Save the load to the specified jid