I have some tasks that use the ufw module to add firewall rules, which up
until now have been working fine. Today however, I added the 'log'
parameter to the ufw task and I got the following error: "ERROR: Invalid
interface clause".

My task definition is below:

- name: apply rules using 'firewall' variable defined in inventory vars
  ufw:
    port: "{{ item.0.port|default(omit) }}"
    proto: "{{ item.0.proto|default(omit) }}"
    src: "{{ item.1 }}"
    rule: "{{ item.0.rule }}"
    direction: "{{ item.0.direction|default(omit) }}"
    log: "{{ item.0.log|default('no') }}"
    state: enabled
  with_subelements:
    - "{{ firewall.rules }}"
    - src

The troublesome firewall variable that's failing for the task above is:

firewall:
  rules:
    ssh:
      port: 22
      proto: tcp
      src: "{{ ips.ssh }}"
      rule: allow
      direction: in
      log: 'yes'

If I remove log: "{{ item.0.log|default('no') }}" from the ufw task it
works fine.

Thanks,
Guy

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CANNH9mtHQz9qrURUBx_dAb4E1ZFaoVNGXQ%2BrNK0NYw6fL5wabQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to