Hi everyone,
I’m looking to execute a command for each items in an inventory group - in this case for each item in a “staging-webservers” group, I want to allow access to it in the firewall.
This doesn’t seem to work but here is kind of what I want to do:
- name: Update firewall rules
command: sudo ufw allow proto tcp from $item to port 9200
with_items:
- [staging-webservers]
In addition if I wanted to write a list of hosts from a group into a template how can I do that?
Thanks in advance,
Alex