1、ansible的配置文件hosts,如果配置了ssh_user,ssh_pass;但是配置文件ansible.cfg中开启host_key_checking 执行命令会失败,报错如下:
| FAILED | rc=-1 >>
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不支持这一点。请将此主机的指纹添加到已知的\u hosts文件以管理此主机。
2、处理办法修改:
host_key_checking = False,
#关闭主机密钥检查;