Ansible Error:【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.】
该错误详请如下:
1 2 3 4 5 6 7 8 |
[root@linux ansible-center-base]# ansible -i conf/hosts_normal mysql -m ping node2 | 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." } node1 | 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@linux ansible-center-base]# |
修改:/etc/ansile/ansible.cfg
1 2 3 |
[root@linux ansible-center-base]# cat /etc/ansible/ansible.cfg | grep "host_key_checking = False" host_key_checking = False [root@linux ansible-center-base]# |
再次查看就没问题了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@linux ansible-center-base]# ansible -i conf/hosts_normal mysql -m ping node1 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } node2 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } [root@linux ansible-center-base]# |