--- # A restart of nftables.service (on a package upgrade) flushes the rules ufw loaded. Mask only: # a stop would flush them now. README Notes has the detail. - name: Mask nftables.service without stopping it become: true ansible.builtin.systemd_service: name: nftables.service masked: true when: - ufw_enabled - ufw_mask_nftables