解决ansible首次连接host服务器需验证问题
问题描述:
[root@iZm5e79rtwsq2hm57teyk5Z ansible]# ansible aofeng -f 5 -m ping 47.93.18.191 | FAILED! => { "failed": true, "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@iZm5e79rtwsq2hm57teyk5Z ansible]
host_key_checking = False默认是注释掉的
打开 host_key_checking = False的注释。同样也可以实现跳过 ssh 首次连接提示验证部分。