Hi,

The easiest way imo is to define groups in your inventory. Group the 
servers that use the same war file togther, and then add a corresponding 
var file for that group in group_vars. In group vars define a list of the 
wars on that server. 

E.g.: qa01.yml

war_files: 
  - /something/app1.war
  - /something/app2.war


Then in your playbook you can simply just call:

tasks:
 - name: rename war files
   shell: cp /tmp/staging.war /usr/local/tomcat1/webapps/{{ item }}
   with_items: war_files


Depending on which server you are on, it will deploy the specific war files 
defines in your corresponding group vars


On Monday, September 14, 2015 at 8:20:07 AM UTC-4, Aaron Eldridge wrote:
>
> Hi there, Im just starting with ansible so I appologise if this is a 
> stupid question.
>
> I have am wanting to try do use ansible to deploy .war web app's to 
> several QA servers. Each QA server hosts serveral instances of the app's 
> across multiple instances of tomcat per server (production is 1 per 
> server). 
>
> I was wanting to write a play book that would connect to each QA server, 
> copy the war files to each insteance on tomcat in on the server then move 
> onto the next box.
>
> The problem I originally had was I put each app as its own inventory item 
> (with the same host name), I found that this did not work. So I now have 
> just the 4 QA servers in there now. 
>
> Is there a good way do declare what app should be on what tomcat under 
> each server in the inventory or should that be in the playbook?
>
> Thank you for reading.
>

-- 
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/0be22b44-7c25-44be-abce-c94d52da0757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to