[size=large]saltstack 学习之note groups[/size]
【基本介绍】
这里介绍saltstatck的分组
【配置】
配置文件:/etc/salt/master
【组合】
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
command line
【参考】
[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]
【基本介绍】
这里介绍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]