sed -i "71a host_key_checking=False" /etc/ansible/ansible.cfg
1 2 3 4
为什么要设置默认不检查key? 因为如下 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. 使用SSH密码代替密钥是不可能的,因为主机密钥检查是启用的,而sshpass不支持这一点。请将该主机的指纹添加到known_hosts文件中以管理该主机。