I really thought I tested your variant :-/
thanks anyway.
On Tuesday, May 13, 2014 6:45:14 PM UTC+2, Matt Martz wrote:
>
> You when line need to be manipulated just a bit to look like:
>
> when: ansible_lo.ipv4.address == "127.0.0.1"
>
> You don't need {{}} in a when statement, you don't need to
You're getting an error because both the left and right value need to be
quoted due to the extra template evaluation you had requested, which is why
Ansible is giving the warning about this.
This is simplified if you leave off the unneccessary {{ foo }} and just say
"foo".
On Tue, May 13, 2014 a
You when line need to be manipulated just a bit to look like:
when: ansible_lo.ipv4.address == "127.0.0.1"
You don't need {{}} in a when statement, you don't need to quote the whole line
and you need to individually quote the IP address.
--
Matt Martz
m...@sivel.net
On May 13, 2014 at 11:17:24
Hello,
Running this test playbook, I have the following error:
- hosts: localhost
tasks:
- name: Test IP address
debug: msg="ok"
when: "{{ ansible_lo.ipv4.address }} == 127.0.0.1"
[WARNING]: It is unneccessary to use '{{' in conditionals, leave variables
in
loop expressions bare.