---

- name: install firewalld
  pacman:
    name: firewalld
    state: present

- name: install firewalld config
  template: src=firewalld.conf.j2 dest=/etc/firewalld/firewalld.conf owner=root group=root mode=0644
  notify:
    - restart firewalld

- name: start and enable firewalld
  service:
    name: firewalld
    enabled: "{{ configure_firewall }}"
    state: "{{ configure_firewall | ternary('started', 'stopped') }}"

- name: disable default dhcpv6-client rule
  ansible.posix.firewalld:
    service: dhcpv6-client
    state: disabled
    immediate: true
  when: configure_firewall
