We have an java web app (war) running on Ubuntu, which is time consuming to a) setup and b)install updates. We want to automate it, but we dont know where the line between what an rpm package can do, and what a config tool such as puppet/chef/salt etc. can/should do. We don't have the resources to try everything.
There are two servers to config once - one with mysql, the other with tomcat & java. Each requires config files to be edited (my.cnf, server.xml), as well as other stuff installed (such as sendmail), creating a user for our app, adding a config file in ~/.grails with environment specific settings. Presumably this could only be done through something like puppet, or by hand, not with an rpm script.
Secondly, our app has a number of steps to go through. we were about to try to learn & use rpm, but we are not sure if this is the correct approach.
This is what we do to install our app:
- wget liquibase and unpack in our system users home dir.
- copy our war and liquibase file tar.
- create a script to run liquibase against the mysql server, and replace the IP/DB name with whatever that environment uses.
- stop tomcat.
- run the script to update the DB schema.
- drop the war into the webapps dir.
- start tomcat.
- check the log files for errors.
The issue is we don't know how to get the rpm to know things like the mysql servers ip address, unless one should use environment variables? Or should we not use rmp at all, just use puppet to do everything?
The question is, what is the guideline for what should be done with RPM, and what should be done outside it, in terms of
a. the initial server configuration with things like mysl, tomcat and a system user, and
b. the installation of updates to our app (which is usually just a new war and a new liquibase changelog which has to be executed), but could occasionally require config file changes.
Both can move files around, and run scripts.
Our app has no source to compile, and it is independent of any architecture (just need java)