On 2013-12-17 10:27 pm, Michael DeHaan wrote:
Absolutely not.

--- # some var
basedir: '/some/path'
 foo:  
  path1: '{{ basedir }}/filename'
  path2: '{{ basedir }}/filename' 

What you were doing was reference a structure that somehow 'knew' it's
variable name before it was even created, so I think it's quite fine
if that isn't a thing.

It working before was a side effect of the legacy template engine
being rather ... special.

It's even more general than that.  This doesn't work:

--- # some var

foo:
  dir: '/some/path'

foo:
  path1: '{{foo.dir}}/filename'
  path2: '{{foo.dir}}/filename2'

Any kind of self-reference gets quashed in 1.4.1. Bummer. I work with Andrew Widdersheim and we've been using this motif often in our playbooks and roles.

I dislike having to use top-level variables in this way. Keeping it all in the hash feels cleaner to me.

--[Lance]

--
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.

Reply via email to