ansible 连通测试

[root@ftp:/root]
> ansible ansible01 -m ping
ansible01 | UNREACHABLE! => {
    "changed": false, 
    "msg": "Failed to connect to the host via ssh: Warning: Permanently added 'ansible01,192.168.31.176' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", 
    "unreachable": true
}

[root@ftp:/root]
> ansible ansible01  -u root -k -m ping
SSH password: 
ansible01 | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}

         

ansible  ansible01  -u  root    -k      -m  ping  
 命令       主机        用户    询问密码     模 块      参数

  

原文地址:https://www.cnblogs.com/liweiming/p/10547360.html