ansible 远程命令
ansible <hostgroup> -m <module> -a <command>[root@localhost ~]# ansible 192.168.127.129 -m command -a "w"
192.168.127.129 | SUCCESS | rc=0 >>
20:58:47 up 35 min, 2 users, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.127.1 20:24 34:30 0.01s 0.01s -bash
root pts/1 192.168.127.128 20:58 0.00s 0.13s 0.00s wansible-doc <module> : ansible官方使用手册[root@localhost ~]# ansible 192.168.127.129 -m ping
192.168.127.129 | SUCCESS => {
"changed": false,
"ping": "pong"
}最后更新于