其他分享
首页 > 其他分享> > ansible初次安装ping不通

ansible初次安装ping不通

作者:互联网

贴上报错:

[root@ansible ~]# ansible -i /etc/ansible/hosts web -m ping
192.168.0.203 | FAILED! => {
    "msg": "Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this host's fingerprint to your known_hosts file to manage this host."
}

后来找啊找啊终于找到问题所在:

root@ansible ~]# vim /etc/ansible/ansible.cfg 

在文件中进行搜索定位到

:/host_key_checking
#host_key_checking = False
修改后:
host_key_checking = False

(就是去掉注释保存)

然后:

[root@ansible ~]# ansible -i /etc/ansible/hosts web -m ping
192.168.0.203 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
}


 

标签:checking,ping,etc,host,ansible,key,不通
来源: https://blog.csdn.net/m0_61664359/article/details/120669129