# ansible playbook error using firewalld to set policy

**URL:** <https://forum.ansible.com/t/ansible-playbook-error-using-firewalld-to-set-policy/38290>\
**Category:** Ansible Project\
**Created:** [August 3, 2023, 4:32am UTC](https://forum.ansible.com/t/ansible-playbook-error-using-firewalld-to-set-policy/38290 "2023-08-03T04:32:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepak\_B\_K](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/deepak_b_k/32/5151_2.png) [@Deepak\_B\_K](https://forum.ansible.com/u/Deepak_B_K)\
**Post date:** [August 3, 2023, 4:32am UTC](https://forum.ansible.com/t/ansible-playbook-error-using-firewalld-to-set-policy/38290/1 "2023-08-03T04:32:31Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![mdidomenico](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@mdidomenico](https://forum.ansible.com/u/mdidomenico)\
**Post date:** [August 3, 2023, 6:24pm UTC](https://forum.ansible.com/t/ansible-playbook-error-using-firewalld-to-set-policy/38290/2 "2023-08-03T18:24:10Z")

</div>

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
