在ansible配置文件中找到 /etc/ansible/ansible.cfg

方法1

在配置文件中找到

了解到问题原因为,我们了解到进行ssh连接时,可以使用-o参数将StrictHostKeyChecking设置为no,使用ssh连接时避免首次连接时让输入yes/no部分的提示。通过查看ansible.cfg配置文件,发现如下行:

[ssh_connection]
# ssh arguments to use
# Leaving off ControlPersist will result in poor performance, so use
# paramiko on older platforms rather than removing it
#ssh_args = -o ControlMaster=auto -o ControlPersist=60s

 

修改配置文件:

ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no 

 

方法2

在配置文件中找到

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

默认host_key_checking部分是注释的,通过找开该行的注释,同样也可以实现跳过 ssh 首次连接提示验证部分。由于配置文件中直接有该选项,所以推荐用方法2 

 

相关文章:

  • 2021-07-10
  • 2021-12-21
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
猜你喜欢
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2021-11-06
  • 2021-12-24
  • 2022-12-23
  • 2021-07-15
相关资源
相似解决方案