I am trying to create a list from a set of variables and have some problem 
doing that.

I must admit I do not understand why it is not easy to manipulate 
list/dict/vars in Ansible. I must be missing somthing.

So here is my issue:


-set_fact:
     my_list: ["abc"]      # ok
     index: 0                  # ok
     
- debug: var=my_list[{{index}}]           #ok
- debug: var=public_subnets[0]         #ok

-set_fact:  
    abcd: "{{ my_list[index] }}"                   #ok
    my_list["{{index}}"]: "abcdefg"             # does not work
    my_list[0]: "abcdefg"                          # does not work
    my_list.append( "abcdefg")                #  does not wokr 


is there a way to assign a value to  my_list ins the index location or to 
append to the end of the list

 

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7275bb72-9736-4c0a-a2e4-662b7a0dc71b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to