- hosts: test.example.com, test1.example.com
gather_facts: false
tasks: - name: checking uptime for {{ ansible_hostname }}
command: uptime
when: ( “slave” in uriresult.content )
One more thing i don’t want to use gather_facts: true
You can use inventory_hostname.
This takes the name of the hosts as configured in the inventory file.
can you point me to Ansible doc For this also
I need to use only test or test1