# UFW module issues

**URL:** <https://forum.ansible.com/t/ufw-module-issues/22434>\
**Category:** Ansible Project\
**Created:** [August 31, 2016, 5:34pm UTC](https://forum.ansible.com/t/ufw-module-issues/22434 "2016-08-31T17:34:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guy\_Knights](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Guy\_Knights](https://forum.ansible.com/u/Guy_Knights)\
**Post date:** [August 31, 2016, 5:34pm UTC](https://forum.ansible.com/t/ufw-module-issues/22434/1 "2016-08-31T17:34:52Z")

</div>

I’m running into a confusing issue with the UFW module. I’ve been using the same role to configure my rules for a while without any problems, but recently I pulled the latest updates for stable-2.1 and now I’m getting the following error for the task below:

- name: enable firewall policy if specified  
ufw:  
policy: reject  
state: enabled  
when: “{{ firewall.enabled }} == True”

FAILED! =\> {“changed”: false, “failed”: true, “msg”: “Direction must be specified when creating a rule on an interface”}

I haven’t specified an interface so the error doesn’t really make sense to me, but all the same I tried adding a direction parameter to the above task, and after doing so it gives me the following different error:

FAILED! =\> {“changed”: false, “failed”: true, “msg”: “ERROR: Invalid syntax\n”}

In the docs for the UFW module it has the following example which is, for all intents and purposes, the same as my original task:

# Allow everything and enable UFW

ufw: state=enabled policy=allow

Any help would be appreciated!

Thanks,  
Guy

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [September 20, 2016, 3:24pm UTC](https://forum.ansible.com/t/ufw-module-issues/22434/2 "2016-09-20T15:24:32Z")

</div>

This looks like a bug introduced into the module, please open a ticket at [https://github.com/ansible/ansible-modules-extras/](https://github.com/ansible/ansible-modules-extras/).

Fill in the template and give as much information as you can.
