运行:ansible -i hosts_example all -m ping 报错
> app | 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 fihost."
> }
解决办法:
vi /etc/ansible/ansible.cfg
在文件找到,并做如下修改:
# uncomment this to disable SSH key host checking
#host_key_checking = False
修改后:就是把前面得#号去掉
# uncomment this to disable SSH key host checking
host_key_checking = False
按
Esc
输入,保存
:wq
再试一下:可以ping通,解决