有时候简单想在所有的机器上跑一个命令,实在用不到写playbook ,可以使用如下命令
1 |
ansible -i /home/ansible/inv all -m shell -a "sudo netstat -nltp | grep 8009"> fpp-netstat-8009 |
注意,必须是用shell 模块才支持”|”
还可以通过 –forks 来控制并发
1 |
--forks=1 |
Latest posts by Zhiming Zhang (see all)
- ReplicationController and ReplicaSet in Kubernetes - 12月 20, 2021
- public key fingerprint - 5月 27, 2021
- Index brackets must contain either a literal number or a literal string.terraform taint - 5月 20, 2021