Saltstack Study Notes 5-pillar

Source: Internet
Author: User
Tags saltstack

The main function of pillar in Saltstack is to store and define some data needed in configuration management, such as software version number, user name password and other information, its definition storage format is similar to grains, it is YAML format


The primary role of Pillar in Saltstack is to store and define some of the data needed in configuration management


There is a pillar settings option in the master configuration file that specifically defines some pillar related parameters:

#pillar_roots:

# Base:

#-/srv/pillar


Need to understand pillar_roots related configuration, pillar working directory under the default base environment in/srv/pillar directory


If you want to define a different pillar working directory for multiple environments, you only need to modify this configuration file to


Here we use the default path, if you use the default path, create the directory Mkdir-pv/srv/pillar

Create a Top.sls portal file in the pillar directory that references two files


Base: #指定环境

' * ' #target

-Packages #引用packages. SLS or Packages/init.sls

-Services #同上


Create a Packages.sls file

Zabbix

Package-name:zabbix

version:2.2.4


Create a Services.sls file

Zabbix

port:10050

User:admin


Use the following command to view some of the module usages related to pillar

Salt ' minion1 ' sys.list_functions pillar

Minion1:

-Pillar.data

-Pillar.ext

-Pillar.get

-Pillar.item

-Pillar.items

-Pillar.raw


Detailed usage and examples can be viewed through the command salt ' minion ' Sys.doc pillar

View the pillar that you just defined

Salt ' minion1 ' Pillar.item Zabbix

Minion1:

----------

Zabbix

----------

Package-name:

Zabbix

Port

10050

User

Admin

Version

2.2.4

--------------------------------------------------------------------------

Saltstack supports reading pillar data externally, we can store pillar data on a database or storage server, where it is not stored and used.

This article from "Eight Miles" blog, declined reprint!

Saltstack Study Notes 5-pillar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.