1. 程式人生 > >ansible小結(四)ansible.cfg與默認配置

ansible小結(四)ansible.cfg與默認配置

false 跳過 ans sts host ase sin class 配置

FAILED => 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串,ssh第一次連接的時候一般會提示輸入yes 進行確認為將key字符串加入到 ~/.ssh/known_hosts 文件中。

在ansible.cfg配置文件中,也會找到如下部分:

  1. # uncomment this to disable SSH key host checking
  2. host_key_checking = False

默認host_key_checking部分是註釋的,通過找開該行的註釋,同樣也可以實現跳過 ssh 首次連接提示驗證部分。由於配置文件中直接有該選項,所以推薦用該方法。

ansible小結(四)ansible.cfg與默認配置