ansible避免首次执行报错disable SSH key host checking
利用ansible执行批量任务时,有时会遇到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/known_hosts文件里没有fingerprint key串,要输入yes,但ansible不会自动输入这个yes,所以会提示报错。
解决办法:
修改/etc/ansible/ansible.cfg配置文件
host_key_checking = False
然后保存退出,在次执行,就没问题了
评论