Hi,
I can't find any easy way how to do something like this:
- set_fact:
"mydict[{{ myvar }}]": "value"
vars:
myvar: "blabla"
However it does not work, because the variable name is not evaluated. The
only way I found to do this is very ugly:
- set_fact:
mydict: "{{ mydict | combine({ myvar: 'value' }, recursive=true) }}"
vars:
myvar: "blabla"
That is very ugly and can get out of hand quickly when going into deeper
nested dictionaries.
Any ideas how to make it "nicer"?
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a7a6a255-65b1-48ef-9f21-1f71023b3933n%40googlegroups.com.