salt note groups - compound matchers

saltstack 学习之note groups
【基本介绍】
这里介绍saltstatck的分组

【配置】
配置文件:/etc/salt/master
nodegroups:
  group1: '[email protected],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 [email protected],minion3.domain.com or bl*.domain.com
I Pillar glob I@pdata:foobar
S Subnet/IP address [email protected]/24 or [email protected]
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


【参考】
http://salt.readthedocs.org/en/latest/topics/targeting/nodegroups.html#targeting-nodegroups
http://salt.readthedocs.org/en/latest/topics/targeting/compound.html

你可能感兴趣的:(saltstack,compound,notegroups)