5. Pillar
pillar and grains are not the same, they are defined on the master and are some information that is defined for minion. Like some of the more important data (passwords) can exist in pillar, you can also define variables and so on.
View the pillar value for the specified minion (the version I tested is empty):
Salt ' client.aming.com ' Pillar.items
Configure the Custom pillar
Vim/etc/salt/master//operation on Master
Locate the following configuration:
pillar_roots:
Base:
-/srv/pillar
remove the front siren.
Mkdir/srv/pillar
Vi/srv/pillar/test.sls//content is as follows
conf:/etc/123.conf
Vi/srv/pillar/top.sls//content is as follows
Base:
' client.aming.com ':
-Test
Module name cannot be a number
Restart Master
/etc/init.d/salt-master Restart
after the pillar configuration file is changed, we can get the new pillar state by refreshing the pillar configuration:
Salt ' * ' saltutil.refresh_pillar
Verify:
Salt ' * ' Pillar.item test
Pillar can also be used as a matching object for salt. Like what
Salt-i ' conf:/etc/123.conf ' test.ping
Saltstack--pillar