Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Saltstack data system-- pillar

Shulou Source: shulou.com Published: 2022-06-01 02:54:39 10月02日 Update

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

Tags: Data storage host location example again dynamic only data collection mode type three lines location application service demonstration configuration system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL macOS MariaDB Shulou Technology