- hosts : all
tasks:
- debug: var=inventory_hostname
If this playbook is executed on multiple servers, does it work like ping test or does it only give the inventory varible without reaching the server through ssh.
You can run the playbook with the -vvvvv
flag to get all debug information Ansible can produce.
You will notice that for this particular playbook you prepared, Ansible will connect to the servers to run the "facts gathering" routines (since you omitted it, its assumed that gather_facts = true
).
If you explicitly set gather_facts = false
and run again, you will see that in the debug information that Ansible doesn't SSH to the servers.