salt note groups - compound matchers

本文详细介绍SaltStack的分组配置,包括配置文件、组合方式和使用示例,帮助理解如何利用SaltStack进行高效运维。
[size=large]saltstack 学习之note groups[/size]
【基本介绍】
这里介绍saltstatck的分组

【配置】
配置文件:/etc/salt/master

nodegroups:
group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com or bl*.domain.com'
group2: 'G@os:Debian and foo.domain.com'



【组合】
Letter Match Type Example
G Grains glob G@os:Ubuntu
E PCRE Minion ID E@web\d+\.(dev|qa|prod)\.loc
P Grains PCRE P@os:(RedHat|Fedora|CentOS)
L List of minions L@minion1.example.com,minion3.domain.com or bl*.domain.com
I Pillar glob I@pdata:foobar
S Subnet/IP address S@192.168.1.0/24 or S@192.168.1.100
R Range cluster R@%foo.bar

【例子】
sls file

base:
'webserv* and G@os:Debian or E@web-dc1-srv.*':
- match: compound
- webserver


command line

salt -C '* and not G@kernel:Darwin' test.ping


【参考】
[url]http://salt.readthedocs.org/en/latest/topics/targeting/nodegroups.html#targeting-nodegroups[/url]
[url]http://salt.readthedocs.org/en/latest/topics/targeting/compound.html[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值