Hey guys,
I've written a playbook that defines the configuration policies for an "application server" running nodejs. I've been using this playbook to provision a vagrant box (local sandbox) with great success but now I want to use this playbook to provision sandboxes in the cloud.
Ultimately I'd like to be able to spin up and provision an infinite number of environments, each existing as their own subdomain e.g. sandbox1.mydomain,com
sandbox2.mydomain.com. I've looked into spinning up instances and dynamically so that they are added to my inventory allowing me to then target them for provisioning easily:
[appservers]
1.2.3.4
5.6.7.8
--- hosts: appservers
roles: nodejs
However, how do I distinguish between sandbox1 and sandbox2 in the inventory file whilst maintaining the "appserver" policy? I would like the run a deployment script that only targets the specified sandbox? I was thinking something along the lines of:
[appservers]
1.2.3.4
5.6.7.8
[sandbox1]
1.2.3.4
[sandbox2]
5.6.7.8
And then I can target --limit sandbox1 to only run the deployment task against this group.
Is this a valid way of achieving my goal?