infra/ansible/roles/firewalld/tasks/main.yml
2023-08-02 12:32:43 +02:00

30 lines
709 B
YAML

---
- name: Install firewalld
ansible.builtin.package:
name: firewalld
state: present
- name: Install firewalld config
ansible.builtin.template:
src: firewalld.conf.j2
dest: /etc/firewalld/firewalld.conf
owner: root
group: root
mode: 0644
notify:
- Restart firewalld
- name: Start and enable firewalld
ansible.builtin.service:
name: firewalld
enabled: "{{ firewalld_configure }}"
state: "{{ firewalld_configure | ternary('started', 'stopped') }}"
- name: Disable default dhcpv6-client rule
ansible.posix.firewalld:
service: dhcpv6-client
state: disabled
immediate: true
when: "firewalld_configure and firewalld_disable_dhcpv6_client"
...