I'd look at a parameterised role. you can apply the role multiple times to
the same
group of nodes with different parameters.

    http://docs.ansible.com/ansible/playbooks_roles.html


On 2 October 2015 at 18:25, Dale <[email protected]> wrote:

> 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
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/2f94e686-300c-43b2-9847-5e0849e4b9ef%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/2f94e686-300c-43b2-9847-5e0849e4b9ef%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK5eLPSsFQUFV6UvyzZ3udMJxKXrM_%2BTnPXY0TBbCA-fQZJ1YQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to