# Can one add items to a list within(!) the inventory?

**URL:** <https://forum.ansible.com/t/can-one-add-items-to-a-list-within-the-inventory/24745>\
**Category:** Ansible Project\
**Created:** [June 16, 2017, 9:49am UTC](https://forum.ansible.com/t/can-one-add-items-to-a-list-within-the-inventory/24745 "2017-06-16T09:49:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Thommen](https://avatars.discourse-cdn.com/v4/letter/f/7feea3/32.png) [@Frank\_Thommen](https://forum.ansible.com/u/Frank_Thommen)\
**Post date:** [June 16, 2017, 9:49am UTC](https://forum.ansible.com/t/can-one-add-items-to-a-list-within-the-inventory/24745/1 "2017-06-16T09:49:06Z")

</div>

Hi,

is it possible to expand a list variable within the inventory? E.g. I have a list of users which should be allowed on all hosts but on /some/ hosts, additional users should be allowed. I want to define this in the inventory:

So far I so:

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 16, 2017, 2:29pm UTC](https://forum.ansible.com/t/can-one-add-items-to-a-list-within-the-inventory/24745/2 "2017-06-16T14:29:10Z")

</div>

Yes and no, variables cannot 'self reference' so they cannot all be  
named `users`. Even then, not in the ini file format, you need to  
either use a YAML inventory or YAML group\_vars/host\_vars
