ansible playbook error using firewalld to set policy

Hi Group,

I am trying to write an ansible playbook to block all incoming traffic on the external interfaces . I am getting the error message “parameters are mutually exclusive:”.

I appreciate a quick help I am missing any mandatory parameters?

@title Enable firewall services.

@comment This tasks enables firewalld services for vms

  • name: Enable firewalld service
    ansible.builtin.service:
    service: firewalld
    state: started

@title Restrict external interfaces

@comment This tasks blocks internal traffic from external interfaces.

  • name: “Restrict external interfaces”
    ansible.posix.firewalld:
    interface: “{{ item }}”
    permanent: true
    state: present
    target: ‘DROP’
    zone: external
    with_items:
  • “eth2”
  • “eth3”

i'm not an expert, but i think it's the combination of interface and
target that's tripping you up. believe you have to splt the interface
assignment and the zone assignment into two seperate tasks