--- - hosts: lighthouses become: true tasks: - name: Allow UDP 4242 ansible.builtin.iptables: action: insert chain: INPUT protocol: udp match: udp destination_port: 4242 jump: ACCEPT - name: Allow TCP 4242 ansible.builtin.iptables: action: insert chain: INPUT protocol: tcp match: tcp destination_port: 4242 jump: ACCEPT