Assign dictionnary variable to another variable in Yaml file

346 views
Skip to first unread message

judau...@gmail.com

unread,
Mar 5, 2014, 6:40:18 AM3/5/14
to ansible...@googlegroups.com
Hi,

I would like to assign dictionnary variable to a another variable like that :

---
dict1
:
    key1
: 'value1'
    key2
: 'value2'


dict2
: {{dict1}}
This doesn't work because, it's break the yaml syntax, if I use dict2: "{{dict1}}" , dict2 is a string where dict1 is transform as a string.

How can I make the assigment to have dict2 as a dictionnary and not a string ?

Thanks in advance for your answers,

Best regards,
Julien

judau...@gmail.com

unread,
Mar 5, 2014, 6:50:14 AM3/5/14
to ansible...@googlegroups.com
Sorry to have bother you.
In fact : 
dict2: "{{dict1}}"
works well.

My mistake.

Best regards,
Julien
Reply all
Reply to author
Forward
0 new messages