I'm getting a benign warning below:

```
 [WARNING]: when statements should not include jinja2 templating
 delimiters such as {{ }} or {% %}.
 Found: not ansible_check_mode and (zerotier_status != "OK" or
 zerotier_name != "{{ inventory_hostname }}")
```

In this specific case I could get away with dropping the final clause of
the `when` check, but does anybody have an idea how to refactor this to
avoid the warnings in future? I get the feeling I'm missing some very
obvious pattern here.

```yaml
- name: zerotier | authorise this connection
  uri:
    url: https://my.zerotier.com/api/network/{{ net.zerotier.network
    }}/member/{{ zerotier_address }}
    method: POST
    HEADER_Authorization: "Bearer {{ net.zerotier.token }}"
    body_format: json
    body:
      name: "{{ inventory_hostname }}"
      config:
        authorized: true
    return_content: yes
  register: zerotier_authorisation
  when: not ansible_check_mode and (zerotier_status != "OK" or
  zerotier_name != "{{ inventory_hostname }}")
  tags:
    - zerotier
```

-- 
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/1495538414.1499599.985718800.1572CF23%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to