Maybe I wasn't clear so let me start over. Below is a quote from Nick in
another post (
https://groups.google.com/forum/#!msg/ansible-project/EAerV9UZ0KI/gVIP6WUK5UQJ)
where he is having the exact same problem I am having. I think he does a
good job describing the problem. Unfortunately, it doesn't seem to get
answered in that post either. It also seems like the exact same problem
that this github issue (https://github.com/ansible/ansible/issues/4450) is
describing which was apparently fixed. However, I'm still having this same
issue in the 1.4.1 version of Ansible from EPEL. So my questions are this:
- Was this fixed?
- If not is going to get fixed?
- If so when can we expect the fix?
- If not what should the work around look like when converting from
${foo} to {{foo}}?
Here is the example from Nick I spoke of earlier. Surely this is a valid
thing for someone to want to do and I'm not seeing a better way to do it.
For example, assuming a simple role with a tasks/main.yml like this:
---
- name: test
action: debug msg="got {{foo.path}}"
And a vars/main.yml defining a var referencing another var like this:
---
foo:
base: /some/path
path: '{{ foo.base }}/filename'
This fails with the error "recursive loop detected in template string:
{{foo.base}}/filename".
However if I use a dollar variable it succeeds:
---
foo:
base: /some/path
path: '${foo.base}/filename'
Which outputs "got /some/path/filename" as expected. It does not seem to
matter
if fail_on_undefined is set in ansible.cfg or not.
--
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].
For more options, visit https://groups.google.com/groups/opt_out.