30 lines
691 B
YAML
30 lines
691 B
YAML
---
|
|
- name: Enable systemd-firewalld
|
|
become: true
|
|
ansible.builtin.systemd:
|
|
name: firewalld
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Configure firewall interface zones
|
|
become: true
|
|
when: item.value.firewall is defined
|
|
ansible.posix.firewalld:
|
|
interface: "{{ item.key }}"
|
|
zone: "{{ item.value.firewall }}"
|
|
state: enabled
|
|
permanent: true
|
|
immediate: true
|
|
loop: "{{ skylab_networking | dict2items }}"
|
|
loop_control:
|
|
label: "{{ item.key }}"
|
|
|
|
- name: Configure firewall for docker interface
|
|
become: true
|
|
when: "'docker0' in ansible_interfaces"
|
|
ansible.posix.firewalld:
|
|
interface: docker0
|
|
zone: dmz
|
|
permanent: true
|
|
immediate: true
|