Ansible UFW module: inaccurate documentation?

Having a hell of a time getting UFW to play nicely. Here’s what I’ve got:

Each role (in this case the role is “common”, part of our baseline role) has a ufw.yml task file that gets imported to main.yml:

With regards to the variable question:

with_items:

  • { ip: “10.0.0.0/8”, port: “any” }
  • { ip: “172.16.0.0/12”, port: “any” }
  • { ip: “192.168.0.0/16”, port: “any” }
  • { ip: “{{ bellevue_office_ip }}”, port: “any” }

Can you include the full output from the part about the protocol error?

Realising that by posting I’m very much raising a zombie, but it’s also the first hit on google when searching for the term “ufw Could not find protocol”, and it’s unsolved; an internet pet peeve of mine.

I’ve had a similar instance of this error today; it stems from the fact that you can’t use the keyword ‘any’ for the to_port or from_port parameters, it appears the only acceptable values are integers.