Hi,

I have a problem provisionning my /etc/hosts files : it seems to me that 
variables are not expanded, and it used to work previously.
I am using ansible 1.7.2.

My host.j2 looks like this:
127.0.0.1       localhost
127.0.1.1       {{ inventory_hostname }}
{% if "frontservers" in group_names or "lbservers" in group_names %}
{% for host in ["{{ site_one }}", "{{ site_two }}", "{{ site_three }}"]%}
127.0.1.1       {{ host }}
{% endfor %}
{% endif %}


My sever file looks like this:
[frontservers]
some-server-01.xxx.com
some-server-02.xxx.com

[all:vars]
site_one=someurl-01.xxx.com
site_two=someurl-02.xxx.com
site_three=someurl-03.xxx.com


Expected result on some-server-01.xxx.com for instance:
127.0.0.1       localhost
127.0.1.1       some-server-01.xxx.com
127.0.1.1       someurl-01.xxx.com
127.0.1.1       someurl-02.xxx.com
127.0.1.1       someurl-03.xxx.com


Actual result on some-server-01.xxx.com:
127.0.0.1       localhost
127.0.1.1       some-server-01.xxx.com
127.0.1.1       {{ site_one }}
127.0.1.1       {{ site_two }}
127.0.1.1       {{ site_three }}


What's wrong ?
How come it stopped working ?

I tried using simple quotes, double quotes in my template file, but the 
result is the same.

Thanks

-- 
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/171c1a3c-200a-404e-83ec-ed2655a29ce4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to