Saltstack-4:数据系统pillar
目的给minion指定的数据,pillar定义参数和变量
默认关闭,开启方法
修改master /etc/salt/master
pillar_opts: Ture
pillar默认文件位置/srv/pillar
# cat apache.sls
{% if grains['os'] == 'CentOS' %}
apache:httpd
{% elif grains['os'] == 'Debian' %}
apche:apche2
{% endif %}
pillar的top.sls
# cat top.sls
base:
'*'
[*]apche
salt '*'pillar.items
结果:
master.test.com:
apache: httpd
slaver.test.com:
apache: httpd
设置完以后要刷新pillar
salt ‘*’ saltutil.refresh_pillar
执行命令
salt -I ‘apache:httpd’ test.ping
页:
[1]