template error: AnsibleUndefinedVariable

33 views
Skip to first unread message

christia...@itsv.at

unread,
Oct 16, 2018, 9:36:59 AM10/16/18
to Ansible Project
hi,

i have a simple template which is driving me nuts, as it throws an bland error. what in blazes does that mean?

the template:

{{ ansible_managed }}

driftfile
/etc/ntp.drift
tracefile
/etc/ntp.trace

{% if inventory_lparname not in groups['DMZ_HOST'] %}
server
10.0.0.1
server some_host
{% elif inventory_lparname in groups['DMZ_HOST'] %}
server
10.0.0.2
{% endif %}


error:

MSG:

AnsibleUndefinedVariable: Unable to look up a name or access an attribute in template string ({{ ansible_managed }}

driftfile
/etc/ntp.drift
tracefile
/etc/ntp.trace

{% if inventory_lparname not in groups['DMZ_HOST'] %}
server
10.0.0.1
server some_host
{% elif inventory_lparname in groups['DMZ_HOST'] %}
server
10.0.0.2
{% endif %}
).
Make sure your variable name does not contain invalid characters like '-': argument of type 'StrictUndefined' is not iterable



Reply all
Reply to author
Forward
0 new messages