tomcat appserver provisioning

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

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.

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

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

Excuse me, tcat server might be a good tool.

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.