I have an ansible playbook and I run it:
sudo ansible-playbook -i hosts startelk.yml -vvv
Every time, after I change the hosts file, running the same playbook results in "Failed to connect to the host via ssh". If I run
ansible all -m ping
first and then the playbook command, the playbook gets successfully started.
Does anyone know why do I have to run ping each time after changing hosts (or some other) file, and then my ssh connection for playbook works, otherwise no? I don't want to be running ping every time I need to change something in Ansible.
Thanks!