Referencing variables within the same datastructure

213 views
Skip to first unread message

Hernandes Sousa

unread,
May 2, 2014, 1:40:55 PM5/2/14
to ansible...@googlegroups.com
Hi,

I'm trying to do the same as mentioned in this issue https://github.com/ansible/ansible/issues/4450 without success:

ansible:
  foo: "value"
  bar: "/tmp/{{ ansible.foo }}"

This causes the following error: recursive loop detected in template string.

I understand this is because I'm referencing a variable created in the same data structure, but Michael mentioned this was fixed on the devel branch 7 months ago, is there a way to accomplish this?

I'm running 1.5.5.

Michael DeHaan

unread,
May 2, 2014, 3:12:04 PM5/2/14
to ansible...@googlegroups.com
Yes, you simply can't do this.

You can reference variables in another datastructure, however.




--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7648e008-1a78-4714-af58-7cb4bc174f66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages