Multiple instances of the same software on a machine

52 views
Skip to first unread message

Dale

unread,
Oct 2, 2015, 1:40:13 PM10/2/15
to Ansible Project
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

Dick Davies

unread,
Oct 12, 2015, 7:23:23 AM10/12/15
to ansible list
I'd look at a parameterised role. you can apply the role multiple times to the same
group of nodes with different parameters.



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2f94e686-300c-43b2-9847-5e0849e4b9ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages