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
first pass:
[client1:vars]
some_server=client1.example.com
some_variable1=30
some_variable2=40
product=1
[client2:vars]
some_server=client1.example.com
some_variable1=30
some_variable2=40
product=2
[client2:vars]
some_server=client1.example.com
some_variable1=30
some_variable2=40
product=1-3
[product1]
application1
[product2]
application1
application2
[product3]
application1
application2
application3
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