If I understand what you want to do, I think you mean this:
shell: /usr/bin/foo --some-parameter {{ inventory_hostname }} # this is what you are looping over in the host loop
delegate_to: “{{ item }}”
with_items: groups.other_group # you are sending the command to every machine in this group
If I understand what you want to do, I think you mean this:
- shell: /usr/bin/foo --some-parameter {{ inventory_hostname }} # this is
what you are looping over in the host loop
delegate_to: "{{ item }}"
with_items: groups.other_group # you are sending the command to every
machine in this group
I knew there must be a way to do this. I think delegate_to will work. Much
appreciated!