Hi
Im working on an ansible role that allows an application with a distributed architecture to be installed on a set of machines. The architecture consists of N independent nodes, which operate within their own address space and communicate through HTTP. So far everything seems straightforward. For each machine, it allow parameters to be overrriden in the inventory file per host. For example,
i.e.
[eastcoast]
eastcoast01 name="node01" memory=2GB
eastcoast02 name="node02" memory=4GB
This serves the purpose but it is possible that multiple nodes need to be installed on the same machine. As far as i can tell this isn't easily supported in Ansible. Each node can potentially have its own configuration settings e.g. different names.
Repeating the same host doesn't achieve what i need - Ansible actions on the host only once.
I considered:
[eastcoast]
eastcoast01 name="node01" memory=2GB instances=2
eastcoast02 name="node02" memory=4GB
But this prevents separate configuration settings per instance. Can anyone suggest a way to achieve this?
Any approach will need to account for the fact i will need to detect multiple instances are on a machine. I'm assuming this can be achieved in Jinja logic.
Thanks
Dale