feat: add option to ignore zones not managed by ansible
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
1cb48879c4
commit
a0b3585f86
@ -108,3 +108,5 @@ firewalld_zones:
|
|||||||
- name: dhcpv6-client
|
- name: dhcpv6-client
|
||||||
- name: cockpit
|
- name: cockpit
|
||||||
firewalld_zones_extra: []
|
firewalld_zones_extra: []
|
||||||
|
|
||||||
|
firewalld_zones_unmanaged: []
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
src: etc/firewalld/zones/zone.xml.j2
|
src: etc/firewalld/zones/zone.xml.j2
|
||||||
dest: /etc/firewalld/zones/{{ item.name }}.xml
|
dest: /etc/firewalld/zones/{{ item.name }}.xml
|
||||||
mode: 0640
|
mode: 0640
|
||||||
loop: "{{ __firewalld_zones }}"
|
loop: "{{ __firewalld_zones | difference(firewalld_zones_unmanaged) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
notify: __firewalld_reload
|
notify: __firewalld_reload
|
||||||
@ -93,7 +93,9 @@
|
|||||||
state: absent
|
state: absent
|
||||||
loop: "{{ __firewalld_zones_active.files | map(attribute='path') | list }}"
|
loop: "{{ __firewalld_zones_active.files | map(attribute='path') | list }}"
|
||||||
notify: __firewalld_reload
|
notify: __firewalld_reload
|
||||||
when: (item | basename | splitext | first) not in (__firewalld_zones | map(attribute='name') | list)
|
when:
|
||||||
|
- (item | basename | splitext | first) not in (__firewalld_zones | map(attribute='name') | list)
|
||||||
|
- (item not in firewalld_zones_unmanaged)
|
||||||
|
|
||||||
- name: Validate deployed configuration
|
- name: Validate deployed configuration
|
||||||
command: firewall-offline-cmd --check-config
|
command: firewall-offline-cmd --check-config
|
||||||
|
Loading…
Reference in New Issue
Block a user