I am trying to compress several pieces of similar code that looks like this:
- ... multiple things is going here register: list_register - name: Generating list set_fact: my_list="{{ list_register.results | map(attribute='ansible_facts.list_item') | list }}"
In fact, the only difference between the two is that I use different list names here instead of my_list
Actually I want to do this:
set_fact: "{{ some var }}" : "{{ some value }}"
I came across this post but could not find the answer here.
Can this be done or is there a workaround?
variables dynamic ansible
Nick roz
source share