关于Saltstack分组的混合匹配:(Compound matchers)
1.修改配置文件,添加组。
[[email protected] ~]# vim /etc/salt/master nodegroups: group1: ‘[email protected],node3‘ group2: ‘[email protected]‘ group3: ‘[email protected]/24‘ group4: ‘[email protected][2-3]‘ [[email protected] ~]# /etc/init.d/salt-master restart Stopping salt-master daemon: [确定] Starting salt-master daemon: [确定]
2.测试添加效果:
[[email protected] ~]# salt -N group1 test.ping node3: True node2: True [[email protected] ~]# salt -N group2 test.ping node3: True [[email protected] ~]# salt -N group3 test.ping node3: True node2: True [[email protected] ~]# salt -N group4 test.ping node2: True node3: True
详细了解,请参考:http://wiki.saltstack.cn/topics/targeting/nodegroups
时间: 2024-10-13 12:23:17