[英]Can we ignore asking to add host in .ssh directory while executing ansible playbook using python ansible module for a new host?
Currently, it's asking to enter yes or no which I want to ignore or pass in program itself, 目前,它要求输入是或否,而我想忽略或传入程序本身,
TASK [Gathering Facts] ************************************************************************************************************************
The authenticity of host '192.168.112.188 (192.168.112.188)' can't be established.
ECDSA key fingerprint is SHA256:UoKxAB0x6sxQCggsklebbnxhdadajdjvsbbb5w.
Are you sure you want to continue connecting (yes/no)?
If you want to see the code for ansible can refer the question, 如果您想查看ansible的代码,可以参考该问题,
'NoneType' object has no attribute 'upper' while running playbook using ansible-python module? 使用ansible-python模块运行剧本时,“ NoneType”对象没有属性“ upper”吗?
You should alter StrictHostKeyChecking
ssh client option. 您应该更改StrictHostKeyChecking
ssh客户端选项。
There are multiple ways to achieve this. 有多种方法可以实现此目的。 For example, set this in your ansible.cfg
: 例如,在您的ansible.cfg
设置:
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.