# Append to list during playbook executions for all hosts

**URL:** <https://forum.ansible.com/t/append-to-list-during-playbook-executions-for-all-hosts/3440>\
**Category:** Get Help\
**Created:** [January 23, 2024, 9:44am UTC](https://forum.ansible.com/t/append-to-list-during-playbook-executions-for-all-hosts/3440 "2024-01-23T09:44:19Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ptn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ptn/32/481_2.png) [@ptn](https://forum.ansible.com/u/ptn)\
**Post date:** [January 23, 2024, 11:59am UTC](https://forum.ansible.com/t/append-to-list-during-playbook-executions-for-all-hosts/3440/3 "2024-01-23T11:59:06Z")

</div>

Hi,

I see you already use facts cache:

```ini
fact_caching = jsonfile
fact_caching_connection = cache

```

Note that [`fact_caching_connection`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#cache-plugin-connection) defines path of the json file you’re storing your facts in, so be sure this path is accessible to the user running you playbook.

Now, you’re showing output for a single run; subsequent ones should update cache and show you updated content in your debug task as well. Is that not the case ?  
If not, first ensure your are indeed using your ansible.cfg file, as [there might be precedence at play here](https://docs.ansible.com/ansible/latest/reference_appendices/general_precedence.html#configuration-settings).

[Here](http://forum.ansible.com/t/dynamic-value-assignment-to-ansible-fact-based-on-condition/706/9) is an example playbook for a similar usecase; perhaps you’ll spot something missing, but your config is looking fine to me.

---

_[View the full topic](https://forum.ansible.com/t/append-to-list-during-playbook-executions-for-all-hosts/3440)._
