Skip to content

Instantly share code, notes, and snippets.

@Mikulas
Last active April 25, 2016 09:57
Show Gist options
  • Save Mikulas/a0f1a15fb1868d3f40e414a15286e8d1 to your computer and use it in GitHub Desktop.
Save Mikulas/a0f1a15fb1868d3f40e414a15286e8d1 to your computer and use it in GitHub Desktop.
ansible bug: incorect values in template variables
outer = original
inner = inner a
in template = inner a
inner = inner b
in template = inner b
outer = original
4c4
< in template = inner a
---
> in template = original
6c6
< in template = inner b
---
> in template = original
outer = original
inner = inner a
in template = original
inner = inner b
in template = original
outer = original
---
- hosts: localhost
vars:
foo: original
foos:
- inner a
- inner b
tasks:
- template:
src: template.j2
dest: /tmp/template
in template = {{ foo }}
outer = {{ foo }}
{% for foo in foos %}
inner = {{ foo }}
{% include "template-inner.j2" %}
{% endfor %}
outer = {{ foo }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment