ansible 使用方法
免密钥方式登陆:
[root@yizhen ~]# ssh-keygen -t rsa
[root@yizhen ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.220.114
下面检查被控端是否被联通
[root@yizhen ~]# ansible all -m ping
192.168.220.114 | success >> {
"changed": false,
"ping": "pong"
}
192.168.220.116 | success >> {
"changed": false,
"ping": "pong"
}