# clients, products, applications ... inventory/host

**URL:** <https://forum.ansible.com/t/clients-products-applications-inventory-host/24395>\
**Category:** Ansible Project\
**Created:** [May 3, 2017, 10:13pm UTC](https://forum.ansible.com/t/clients-products-applications-inventory-host/24395 "2017-05-03T22:13:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scuderia\_FormulaOne](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@Scuderia\_FormulaOne](https://forum.ansible.com/u/Scuderia_FormulaOne)\
**Post date:** [May 3, 2017, 10:13pm UTC](https://forum.ansible.com/t/clients-products-applications-inventory-host/24395/1 "2017-05-03T22:13:21Z")

</div>

I am looking for the ‘best’ practice for the following case where:

there are multiple clients  
a client can have one or more products  
a product is made of 1-5 or more applications  
an application reside on a single vm

I am looking for an example/template, a set of instructions, or a good starting point for:

client1 has product 1

client2 has product 2  
client3 has both product 1-2

Regards,

t

---

<div class="post-metadata">

**Author:** ![Scuderia\_FormulaOne](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@Scuderia\_FormulaOne](https://forum.ansible.com/u/Scuderia_FormulaOne)\
**Post date:** [May 3, 2017, 10:35pm UTC](https://forum.ansible.com/t/clients-products-applications-inventory-host/24395/2 "2017-05-03T22:35:38Z")

</div>

first pass:

☹

[client1:vars]  
some\_server=[client1.example.com](http://client1.example.com)  
some\_variable1=30

some\_variable2=40

product=1

[client2:vars]  
some\_server=[client1.example.com](http://client1.example.com)  
some\_variable1=30

some\_variable2=40  
product=2

[client2:vars]  
some\_server=[client1.example.com](http://client1.example.com)  
some\_variable1=30

some\_variable2=40  
product=1-3

[product1]  
application1

[product2]

application1  
application2

[product3]

application1  
application2

application3

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [May 4, 2017, 7:37am UTC](https://forum.ansible.com/t/clients-products-applications-inventory-host/24395/3 "2017-05-04T07:37:43Z")

</div>

So each client has their own VM?

If so, you can just set host\_vars for each vm, and model each application as  
a role - like this:

├── inventory  
│ ├── host\_vars  
│ │ ├── client1 \<- sets some\_variable1, some\_variable2 for client1  
│ │ ├── client2  
│ │ └── client3  
│ └── hosts  
├── roles  
│ ├── application1 \<- role for application1 that uses some\_variable1, etc.  
│ ├── application2  
│ └── application3  
└── site.yml \<- applies roles to the VM as appropriate
