|
1.globbing 默认
salt '*' test.ping # 匹配所以
salt 'test*' test.ping # 匹配test1,test..
salt '*.test.com' test.ping # 匹配a.test.com,b.test.com....
salt 'test?.xx.com' test.ping # 匹配test1.xx.com,test2.xx.com...
salt 'web[1-5]' test.ping # 匹配web1到web
salt 'web-[x-z]' test.ping # 匹配web-x,web-y,web-z
2.RE 正则
salt -E 'web1-(pro|devel)' test.ping # 匹配web1-pro,web2-devel
3.List 列表
salt -L 'web1, test1' test.ping # 匹配web1,test1
4.grains
salt -G 'os:CentOS' test.ping # 匹配centos系统
salt 'test*' grains.items # 查看所有grains键/值
salt 'test*' grains.ls # 查看所有grains项
salt 'test*' grains.item num_cpus # 查看某个grains的值
|
|
|