# tomcat appserver provisioning

**URL:** <https://forum.ansible.com/t/tomcat-appserver-provisioning/12157>\
**Category:** Ansible Project\
**Created:** [December 21, 2012, 7:27pm UTC](https://forum.ansible.com/t/tomcat-appserver-provisioning/12157 "2012-12-21T19:27:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Newman](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@David\_Newman](https://forum.ansible.com/u/David_Newman)\
**Post date:** [December 21, 2012, 7:27pm UTC](https://forum.ansible.com/t/tomcat-appserver-provisioning/12157/1 "2012-12-21T19:27:26Z")

</div>

Hi there,  
I am new to Ansible and I would like to use it to provision tomcat  
instances. I'm wondering what other people have done in terms of  
playbooks. Would one mimic the way it is done manually? i.e. push a  
tgz file to the remote server, extract it, config it and start it. Or  
would it make sense to have tomcat checked into source control in it's  
configured state and part of the playbook checkout? Or somewhere in  
between?

-Dave

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [December 23, 2012, 1:56pm UTC](https://forum.ansible.com/t/tomcat-appserver-provisioning/12157/2 "2012-12-23T13:56:46Z")

</div>

Tomcat is one of the easiest app servers to configure.

You should probably install tomcat from yum or apt if you can, drop  
the war file in the directory, and have a restart handler  
set on both the wars and any config files. there should also be a  
service state=running that makes sure the service is running  
even if there are no changes.

Whether you move the wars via git or copy is up to you, but I'd  
probably just use copy myself as war files should be build products  
and not checked into source control.

---

<div class="post-metadata">

**Author:** ![David\_Newman](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@David\_Newman](https://forum.ansible.com/u/David_Newman)\
**Post date:** [December 24, 2012, 7:06pm UTC](https://forum.ansible.com/t/tomcat-appserver-provisioning/12157/3 "2012-12-24T19:06:54Z")

</div>

I agree that would be the best way to go. I even started by creating my  
own custom RPMs of tomcat. Unfortunately, as the release engineer,  
I do not have root on these servers.

So, baring the creation of a private RPM database owner by the application  
user, which I haven't ruled out yet, I need to push out un-packaged copies  
of tomcat that get installed in either the home dir or a specified data  
dir.  
Is the copy module the way to go here? To make it idempotent would one  
need to have a playbook that removes the catalina home first before laying  
down a new one?

-Dave

---

<div class="post-metadata">

**Author:** ![Luke\_Tislow](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Luke\_Tislow](https://forum.ansible.com/u/Luke_Tislow)\
**Post date:** [December 24, 2012, 8:27pm UTC](https://forum.ansible.com/t/tomcat-appserver-provisioning/12157/4 "2012-12-24T20:27:34Z")

</div>

I’ve been tasked with a similar task of automating the deployment of tomcat apps. I would think a symlink to current with Catalina home is a definite step.

Our current release engineer also wraps our wars in rpms, which I only see beneficial if we were extending a yum repo correctly. I’m just diving into ansible, I’ve been instructed to attempt to use only one automation tool… not sure if I’ll end up at that state.

If you’re in a dev only environment, that server might be a good tool.

-luke

---

<div class="post-metadata">

**Author:** ![Luke\_Tislow](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Luke\_Tislow](https://forum.ansible.com/u/Luke_Tislow)\
**Post date:** [December 24, 2012, 8:28pm UTC](https://forum.ansible.com/t/tomcat-appserver-provisioning/12157/5 "2012-12-24T20:28:39Z")

</div>

Excuse me, tcat server might be a good tool.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [December 25, 2012, 1:34am UTC](https://forum.ansible.com/t/tomcat-appserver-provisioning/12157/6 "2012-12-25T01:34:55Z")

</div>

> I agree that would be the best way to go. I even started by creating my  
> own custom RPMs of tomcat. Unfortunately, as the release engineer,  
> I do not have root on these servers.
> 
> So, baring the creation of a private RPM database owner by the application  
> user, which I haven't ruled out yet, I need to push out un-packaged copies  
> of tomcat that get installed in either the home dir or a specified data  
> dir.  
> Is the copy module the way to go here? To make it idempotent would one  
> need to have a playbook that removes the catalina home first before laying  
> down a new one?

No idea,

All the tomcat stuff I've deployed (using Tomcat from EPEL, IIRC) just  
required dropping wars in a webapps directory and it would crack them  
and use them automatically.

In any event, the copy module is smart and won't transfer files unnecessarily.
