Ronny,

One way to deal with this is: instead of configuring 6 different hosts
(that are actually the same), make your playbook do all the 6 tasks at
once.

This way you can have a hosts file with something like this:
[applicationservers]
host1

Variables defined inside a "vars file", like:
apps:
- { name=dev1, home="somepath/dev1/...", port="9090" }
- { name=dev2, home="somepath/dev2/...", port="8080" }

And in your role:
tasks:
  -name: deploy our application
  shell: doDeploy.sh {{ appserver_name }} {{ appserver_home }} {{
appserver_port }}
  with_items: apps

For more info about managing your roles I'd recommend:
http://docs.ansible.com/playbooks_roles.html and
http://docs.ansible.com/playbooks_variables.html

Regards,
Hugo

On Wed, Nov 26, 2014 at 1:17 PM,  <[email protected]> wrote:
> On Tue, Nov 25, 2014 at 10:57:37PM -0800, Ronny wrote:
>
>> If I run this, the task "deploy our application" is only executed once. It
>> looks like ansible's smallest unit is the host. But we have here up to 6
>> application servers per host and want to deploy them at once.
>> How should the inventory look like?
>
> I've had similar issues in my time using Ansible. Often I want to test 
> clusterware
> locally beforehand- maybe run 3 etcd instances on one server to validate the 
> config.
>
> Adding additional IP addresses with new hostnames to the host allows me to 
> get by,
> but it's solidly in the realm of dirty hack and I'd love to see ansible grow 
> to
> support this use case.
>
> --
> 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/20141126151747.GX17066%40voodoowarez.com.
> 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/CACJBGXCcihQko4NPEV-v41Bkp7Pn%3D%2B3RmwViRkPBktn8FddFVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to