global_environment_variable is undefined while templating

openstack_hosts role uses global_environment_variable for
creating its environment.j2. If the variable is not defined
the templating will fail.

This should fix it.

Change-Id: I891e99fd624589ee36d6ce4892c835fa5ece9671
This commit is contained in:
Jean-Philippe Evrard
2016-04-27 09:49:30 +01:00
parent a3a01673fa
commit 848cb5529e

View File

@@ -1,10 +1,10 @@
# {{ ansible_managed }}
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
{% if global_environment_variables %}
{% if global_environment_variables is defined %}
{% for key, value in global_environment_variables.iteritems() %}
{% if value %}
{{ key }}={{ value }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}