# Manage Inventory in Ansible

**URL:** <https://forum.ansible.com/t/manage-inventory-in-ansible/19058>\
**Category:** Ansible Project\
**Created:** [August 19, 2015, 4:21pm UTC](https://forum.ansible.com/t/manage-inventory-in-ansible/19058 "2015-08-19T16:21:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![satheesh\_kumar](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@satheesh\_kumar](https://forum.ansible.com/u/satheesh_kumar)\
**Post date:** [August 19, 2015, 4:21pm UTC](https://forum.ansible.com/t/manage-inventory-in-ansible/19058/1 "2015-08-19T16:21:04Z")

</div>

Hi,

Currently i’m using static inventory in ansible and have folder structure like Inventories/inv1, Inventories/inv2, etc..

# Inventories/inv1

[atlanta]

> **[.xyz Domain Names | Join Generation XYZ](https://gen.xyz/)**
>
> .xyz is for every website, everywhere.® We offer the most flexible and affordable domain names to create choice for the next generation of internet users.

[europe]

> **[ABC Network - ABC.com](https://abc.com/)**
>
> Watch the ABC Shows online at abc.com. Get exclusive videos and free episodes.

I need to have group variables for production in a way like Inventories/group\_vars/production which is specific to Prod.

#Inventories/group\_vars/production

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [August 19, 2015, 4:25pm UTC](https://forum.ansible.com/t/manage-inventory-in-ansible/19058/2 "2015-08-19T16:25:17Z")

</div>

> # Inventories/inv1  
> [atlanta]  
> xyz.com
> 
> [europe]  
> abc.com
> 
> I need to have group variables for production in a way like  
> Inventories/group\_vars/production which is specific to Prod.
> 
> #Inventories/group\_vars/production  
> ---
> 
> url: 'jnp://mqendpoint.company.com:1099'  
> env: 'Production'
> 
> How can I glue these two files into a third inventory file  
> Inventories/production.
> 
> What I tried is  
> #Inventories/production  
> [production:children]  
> atlanta  
> europe
> 
> I am getting error as child group is not defined:atlanta, europe

​Because eacht ini file is parsed as if it was a unique inventory.

Just add

---

<div class="post-metadata">

**Author:** ![satheesh\_kumar](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@satheesh\_kumar](https://forum.ansible.com/u/satheesh_kumar)\
**Post date:** [August 19, 2015, 4:58pm UTC](https://forum.ansible.com/t/manage-inventory-in-ansible/19058/3 "2015-08-19T16:58:47Z")

</div>

I added the same

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [August 19, 2015, 5:07pm UTC](https://forum.ansible.com/t/manage-inventory-in-ansible/19058/4 "2015-08-19T17:07:46Z")

</div>

​Now you are pointing your inventory to the production file which only  
holds an empty group 'smtp'​.

---

<div class="post-metadata">

**Author:** ![satheesh\_kumar](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@satheesh\_kumar](https://forum.ansible.com/u/satheesh_kumar)\
**Post date:** [August 19, 2015, 5:43pm UTC](https://forum.ansible.com/t/manage-inventory-in-ansible/19058/5 "2015-08-19T17:43:11Z")

</div>

Can you help me how to refer the group inside Inventories/Inventory1 ?

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [August 19, 2015, 9:17pm UTC](https://forum.ansible.com/t/manage-inventory-in-ansible/19058/6 "2015-08-19T21:17:11Z")

</div>

​ ​
