# define common group for multiple inventory files?

**URL:** <https://forum.ansible.com/t/define-common-group-for-multiple-inventory-files/18122>\
**Category:** Ansible Project\
**Created:** [April 29, 2015, 7:55am UTC](https://forum.ansible.com/t/define-common-group-for-multiple-inventory-files/18122 "2015-04-29T07:55:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torsten\_Reinhard](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Torsten\_Reinhard](https://forum.ansible.com/u/Torsten_Reinhard)\
**Post date:** [April 29, 2015, 7:55am UTC](https://forum.ansible.com/t/define-common-group-for-multiple-inventory-files/18122/1 "2015-04-29T07:55:05Z")

</div>

Hi,

we have to support several environments (Dev, Test, Preview, Prod) - so we have the following structure for our (static) inventory:

`  
inventory  
– group  
---- dev

- hosts
- group\_vars
- host\_vars

---- test

- hosts
- group\_vars
- host\_vars

---- prod

- hosts
- group\_vars
- host\_vars

`

The hosts file looks like

`  
[weblogic]  
domain-1  
domain-2  
…  
domain-5

[domain-1]  
[myserver1.com](http://myserver1.com)

[domain-2]  
[myserver2.com](http://myserver2.com)

[domain-5]  
[myserver5.com](http://myserver5.com)

`

=\> The [weblogic] parent group always has the same entries, while the [domain-x] groups have 1…N servers depending on the environment.

Is there a way to share this “common weblogic group” over all inventories ?  
I want to prevent repeating this group definition.

Thanx for any advice,

Torsten
