Use of {{ }} var syntax in with_nested

Is it possible to use the {{ var.stdout_lines }} syntax in a with_nested construct?

with_nested:
  - {{ var.stdout_lines }}
  - ['some', 'ohter', 'data']

seems to throw an error. However..

with_nested:
  - ${var.stdout_lines}
  - ['some', 'other', 'data']

seems to work.

and

with_nested:
  - var.stdout_lines
  - ['some', 'other', 'data']

tries to use "var.stdout_lines" as a literal list of chars, 'v', 'a', 'r', '.', …

and

with_nested:
  - "{{ var.stdout_lines }}"
  - ['some', 'other', 'data']

treats the big full string of the expanded list as a string of chars, including the brackets.

- var['stdout_lines'] is just a string too.

So, I'm confused!

-jlk

Are you using 1.3?

1.3 is much nicer about this, and will know what you mean in with_nested.

The bare form is correct.

with_nested:

  • var.stdout_lines
  • [‘some’, ‘other’, ‘data’]

Only use {{ foo }} when you want a string, always!

We aren't on 1.3 yet, so I'll mark that routine as being able to go away when we make the move. Thanks!

-jlk