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


 

相关文章

----name:setpublickeyonremotehosts&setreomtehostssud...
环境准备#cat/etcedhat-releaseCentOSLinuxrelease7.9.2009(...
准备好环境,在安装之前请先了解openshift提供的ansible有大...
Ansible:运维工作:系统安装(物理机、虚拟机)-->程序包...
ansible与salt对比相同都是为了同时在多台机器上执行相同的命...
[root@node1playbook]#catnginx.yml-hosts:test\\主...