---
- name: Stop and disable firewalld
  ansible.builtin.systemd:
    name: firewalld
    enabled: false
    state: stopped

- name: Enable IP forwarding
  ansible.posix.sysctl:
    name: net.ipv4.ip_forward
    value: '1'
    sysctl_set: true
    state: present
    reload: true

- name: Install nftables
  ansible.builtin.dnf:
    name: nftables
    state: present

- name: Deploy nftables config
  ansible.builtin.template:
    src: nftables.conf.j2
    dest: /etc/sysconfig/nftables.conf
    mode: '0640'
  notify: Reload nftables

- name: Enable and start nftables
  ansible.builtin.systemd:
    name: nftables
    enabled: true
    state: started
