Use etcd data as a Pillar source
2014.7.0 新版功能.
depends: |
|
---|
In order to use an etcd server, a profile must be created in the master configuration file:
my_etcd_config:
etcd.host: 127.0.0.1
etcd.port: 4001
After the profile is created, configure the external pillar system to use it. Optionally, a root may be specified.
ext_pillar:
- etcd: my_etcd_config
ext_pillar:
- etcd: my_etcd_config root=/salt
Using these configuration profiles, multiple etcd sources may also be used:
ext_pillar:
- etcd: my_etcd_config
- etcd: my_other_etcd_config
The minion_id
may be used in the root
path to expose minion-specific
information stored in etcd.
ext_pillar:
- etcd: my_etcd_config root=/salt/%(minion_id)s
Minion-specific values may override shared values when the minion-specific root appears after the shared root:
ext_pillar:
- etcd: my_etcd_config root=/salt-shared
- etcd: my_other_etcd_config root=/salt-private/%(minion_id)s
Using the configuration above, the following commands could be used to share a key with all minions but override its value for a specific minion:
etcdctl set /salt-shared/mykey my_value
etcdctl set /salt-private/special_minion_id/mykey my_other_value
salt.pillar.etcd_pillar.
ext_pillar
(minion_id, pillar, conf)¶Check etcd for all data