Hi, we aim for a scenario which seems to be not so easy achievable.
We would like to kind of reset/automate the setup of firewalld on CentOS7.
With walking through defined zones setting services/ports/sources.
What we have so far:
FIREWALLD_ZONE_SERVICE:
- ZONE: public
SERVICES:
- SERVICE: http
SERVICE_STATE: disabled
- SERVICE: https
SERVICE_STATE: disabled
- ZONE: trusted
SERVICES:
- SERVICE: http
SERVICE_STATE: disabled
- SERVICE: https
SERVICE_STATE: disabled
- name: Debug FIREWALLD_ZONE_SERVICE
debug:
msg: "{{ item.0.ZONE }} {{ item.1.SERVICE }} {{ item.1.SERVICE_STATE }}"
loop: "{{ FIREWALLD_ZONE_SERVICE|subelements('SERVICES')|list }}"
Works like expected. Each zone gets configured for all given services with
the related state.
We would like to condense things further and loop through zones. Something
like that:
FIREWALLD_ZONE_SERVICE:
- ZONE:
- public
- trusted
- SERVICES:
- SERVICE: http
SERVICE_STATE: enabled
- SERVICE: https
SERVICE_STATE: enabled
How would the loop directive look like to loop through all zones looping
through all services?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/ec7e7e17-42ef-423f-97b2-38b8f4c909c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.