# Try to put 1 Ansible facts from multiple servers into one list

**URL:** <https://forum.ansible.com/t/try-to-put-1-ansible-facts-from-multiple-servers-into-one-list/32722>\
**Category:** Ansible Project\
**Created:** [April 17, 2020, 11:57pm UTC](https://forum.ansible.com/t/try-to-put-1-ansible-facts-from-multiple-servers-into-one-list/32722 "2020-04-17T23:57:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregor](https://avatars.discourse-cdn.com/v4/letter/g/6a8cbe/32.png) [@gregor](https://forum.ansible.com/u/gregor)\
**Post date:** [April 17, 2020, 11:57pm UTC](https://forum.ansible.com/t/try-to-put-1-ansible-facts-from-multiple-servers-into-one-list/32722/1 "2020-04-17T23:57:49Z")

</div>

I feel this should be easy.

I’m trying to put a fact I set on each server into one central list.  
sat\_id is the Big List  
sat\_id\_raw is the variable that I set earlier in the automation.

What am I missing here?

Thanks in advance

name: Put all of the var into a big list

set\_fact:

sat\_id: “{{ sat\_id }} + [‘{{ sat\_id\_raw }}’]”

delegate\_to: localhost

- name: Print object type

debug:

var: sat\_id

delegate\_to: localhost

TASK [Facts-list : Put all of the vars into a big list] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [MY-SERVER1 → localhost] =\> {

“ansible\_facts”: {

“sat\_id”: [

“15929”

]

},

“changed”: false

}

ok: [MY-SERVER2 → localhost] =\> {

“ansible\_facts”: {

“sat\_id”: [

“13409”

]

},

“changed”: false

}

TASK [Facts-list : Print object type] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

task path: /data/grskelt/satellite-devel/satellite-contentviews-list/tasks/main.yml:96

ok: [MY-SERVER1 → localhost] =\> {

“sat\_id”: [

“15929”

]

}

ok: [MY-SERVER2 → localhost] =\> {

“sat\_id”: [

“13409”

]

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [April 18, 2020, 7:42am UTC](https://forum.ansible.com/t/try-to-put-1-ansible-facts-from-multiple-servers-into-one-list/32722/2 "2020-04-18T07:42:47Z")

</div>

> I feel this should be easy.
> 
> I'm trying to put a fact I set on each server into one central list.  
> sat\_id is the Big List  
> sat\_id\_raw is the variable that I set earlier in the automation.
> 
> What am I missing here?  
> Thanks in advance

Try "{{ sat\_id + sat\_id\_raw }}" if sat\_id\_raw is a list, "{{ sat\_id + [sat\_id\_raw] }}" if sat\_id\_raw is  
a single value.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![gregor](https://avatars.discourse-cdn.com/v4/letter/g/6a8cbe/32.png) [@gregor](https://forum.ansible.com/u/gregor)\
**Post date:** [April 18, 2020, 5:00pm UTC](https://forum.ansible.com/t/try-to-put-1-ansible-facts-from-multiple-servers-into-one-list/32722/3 "2020-04-18T17:00:28Z")

</div>

Many thanks, I’ll give it a try.

Greg
