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"
}


 

上一篇:【视频教程】MAME0.238配置分享


下一篇:ansible自动化安装nginx及其配置