# "Simple" set\_fact issue

**URL:** <https://forum.ansible.com/t/simple-set-fact-issue/21241>\
**Category:** Ansible Project\
**Created:** [April 22, 2016, 3:10am UTC](https://forum.ansible.com/t/simple-set-fact-issue/21241 "2016-04-22T03:10:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moshe\_Suberri](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@Moshe\_Suberri](https://forum.ansible.com/u/Moshe_Suberri)\
**Post date:** [April 22, 2016, 3:10am UTC](https://forum.ansible.com/t/simple-set-fact-issue/21241/1 "2016-04-22T03:10:18Z")

</div>

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
