报错内容

image.png ansible-001 | 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.” }

需要将指纹添加到 known_hosts 中

  1. ansible-001 | FAILED! => {
  2. "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."
  3. }

产生的原因:
如果控制端和被控制端第一次通讯,需要先添加指纹信息

解决方法

修改ansible.confg文件, 取消注释 host_key_checking = False

  1. sed -i 's,^#host_key_checking.*$,host_key_checking = Flse,' /etc/ansible/ansible.cfg