Search code examples
ansibleansible-2.xansible-inventory

Ansible hangs on the first run


Whenever I add a new machine and run the playbook for the first time it hangs. When I ssh to that machine from Ansible server and exit and run the playbook again then it works.


Solution

  • Most likely Ansible gets stuck on verifying a host key and when you connect with ssh, you are prompted and confirm it manually.

    Add host_key_checking=false to your Ansible configuration file.