Saltstack data system-- pillar
Pillar storage location: masterside, data type: dynamic data, data acquisition method:
Define it on the master side and assign it to the corresponding minion. You can use saltuitl.refresh_pillar to refresh.
Application: stores the data specified by master. Only the specified minion can see it. Used to store sensitive data.
Use an example to understand:
# salt'* 'pillar.items### is not displayed by default. You need to open the configuration option and restore this item to the line # vim / etc/salt/master###552 after the demonstration. Pillar_opts: True### restart service / etc/init.d/salt-master restart### execute salt'* 'pillar.items again and it will be displayed # define pillar data # # vim / etc/salt/master open The following three lines: pillar_roots: base:-/ srv/pillar save exit mkdir / srv/pillar/etc/init.d/salt-master restart#### # vim / srv/pillar/apache.sls {% if grains ['os'] = =' CentOS'%} apache: httpd {% elif grains ['os'] = =' Debian'%} apache: apache2 {% endif%} # vim / srv/pillar/top.slsbase:'*':-apache # # salt'* 'saltutil.refresh_pillar # refresh salt' * 'pillar.items # # pillar location host # # salt-I' apache:httpd' test.ping