salt.pillar.redismod

Read pillar data from a Redis backend

2014.7.0 新版功能.

depends:
  • redis Python module (on master)

Salt Master Redis Configuration

The module shares the same base Redis connection variables as salt.returners.redis_return. These variables go in your master config file.

  • redis.db - The Redis database to use. Defaults to 0.
  • redis.host - The Redis host to connect to. Defaults to 'salt'.
  • redis.port - The port that the Redis database is listening on. Defaults to 6379.
  • redis.password - The password for authenticating with Redis. Only required if you are using master auth. Defaults to None.

Configuring the Redis ext_pillar

ext_pillar:
  - redis: {function: key_value}
salt.pillar.redismod.ext_pillar(minion_id, pillar, function, **kwargs)

Grabs external pillar data based on configured function

salt.pillar.redismod.key_json(minion_id, pillar, pillar_key=None)

Pulls a string from redis and deserializes it from json. Deserialized dictionary data loaded directly into top level if pillar_key is not set.

pillar_key
Pillar key to return data into
salt.pillar.redismod.key_value(minion_id, pillar, pillar_key='redis_pillar')

Looks for key in redis matching minion_id, returns a structure based on the data type of the redis key. String for string type, dict for hash type and lists for lists, sets and sorted sets.

pillar_key
Pillar key to return data into