How to avoid host key checking during ansible script execution

During execution of ansible playbook or ansible script on new remote host (which you have not connected via ssh so far) the script might fail with below error

 UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ----}

To avoid this you can set the environment variable (ANSIBLE_HOST_KEY_CHECKING) to disable host check before ssh during ansible script execution.

 export ANSIBLE_HOST_KEY_CHECKING=False

Now you can execute the ansible script.

Comments

Popular posts from this blog

Error : login failed on rabbitmq web-management console

MSMQ error : "A workgroup installation computer does not support the operation."

How to flash CWM Recovery to Samsung Galaxy SL( GT-I9003) using Odin