Iv. Saltstack How to manage objects?

Source: Internet
Author: User
Tags saltstack

Pre-Lab Environment:

[Email protected] ~]# salt-key-l
[Email protected] ~]# salt-key-a super65.cn-y

Introduction to Salt Management Objects:

The object that Saltstack manages is called Target.

Many of the objects we manage are those we need to classify different objects. How does the Saltstack classify it?

It is important to plan the ID of the target in the pre-saltstack if it is possible to automate or depend on the ID of the object when managing the object.

1. Regular matching

[Email protected] ~]# salt-e "super.*" test.ping
SUPER66:
True
super65.cn:
True

[Email protected] ~]# salt-e "super.*cn$" test.ping
super65.cn:
True

2. List matching

[Email protected] ~]# salt-l super66,super65.cn test.ping
SUPER66:
True
super65.cn:
True
[Email protected] ~]# salt-l super66 test.ping
SUPER66:
True

3. Grians Matching

[Email protected] ~]# salt-g "Os:centos" test.ping
SUPER66:
True
super65.cn:
True

Grians is a component that saltsatack a custom record minion static information (such as recording CPU, memory, and).

View Grians Help:

[email protected] ~]# Salt ' super66 ' sys.doc grains

4. Group Matching

Define groups (to be defined in the master configuration file)

[Email protected] ~]# salt-n group1 test.ping
SUPER66:
True
[Email protected] ~]# salt-n group2 test.ping
SUPER66:
True
super65.cn:
True

5. Cird Matching

[Email protected] ~]# salt-s "192.168.1.0/24" test.ping
SUPER66:
True
super65.cn:
True

6, composite matching (support the above matching rules with and, or association)

7, pillar value matching (pillar system can be customized key value pairs)

Iv. Saltstack How to manage objects?

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.