How to run task only on the first node in group
How to run task only on first node in group
Check the group array
For example
- name: Ping first node listed in group "tower"
ping:
when: inventory_hostname == groups['tower'][0]
Check the group array
For example
- name: Ping first node listed in group "tower"
ping:
when: inventory_hostname == groups['tower'][0]
Leave a comment