`

salt note groups - compound matchers

阅读更多
saltstack 学习之note groups
【基本介绍】
这里介绍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


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

相关推荐

Global site tag (gtag.js) - Google Analytics