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.

On Wednesday, 30 July 2014 18:48:29 UTC-4, Lars Sommer wrote:
>
> 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:
>
> ---
> - name: Configure UFW for baseline access
>   ufw:
>     rule=allow
>     from_ip={{ item.ip }}
>     to_port={{ item.port }}
>     state=enabled
>   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" }
>   sudo: yes
>
> Now there's two problems- 
> For the with_items entries that have a non-variable value for ip, those 
> lines return "Error: Could not find protocol" 
> For the line that uses the bellevue_office_ip variable, that line returns: 
> "Error: Bad source address"
>
> My confusion is that the protocol parameter shouldn't be mandatory 
> according to the UFW docs page: http://docs.ansible.com/ufw_module.html 
> and that I should be able to use variables in this manner according to the 
> Loops page: http://docs.ansible.com/playbooks_loops.html
>
> What am I missing? I can probably get away from trying to use variables in 
> the with_items loop but boy I'd sure love to use it. The protocol thing 
> though I have no idea, I don't know why that'd be choking me up.
>
> Thanks for any help,
> Lars
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/17b37be0-4f8c-470c-a422-d6c32beb0b52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to