贴上报错:
[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"
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。