UFW module issues

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

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

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