7、saltstack學習 遠程執行
https://www.unixhot.com/docs/saltstack/topics/tutorials/modules.html#arguments
全局匹配
[root@master-1 web]# salt "node-[1-2]" test.ping
node-1:
True
node-2:
True
正則
[root@master-1 web]# salt -E '(master|node)-1' test.ping
node-1:
True
master-1:
True
List方式
[root@master-1 web]# salt -L 'master-1,node-1' test.ping
master-1:
True
node-1:
True
salt所有模塊
https://www.unixhot.com/docs/saltstack/ref/modules/all/index.html
測試所有tcp
network模塊
salt '*' network.active_tcp
service模塊
https://www.unixhot.com/docs/saltstack/ref/modules/all/salt.modules.service.html#module-salt.modules.service
[root@master-1 web]# salt '*' service.available sshd
salt '*' service.reload <service name>

浙公網安備 33010602011771號