views:

63

answers:

2

I am new to installers and up until now have just been manually executing a line by line list of items to install. Clearly this is not a scaleable approach, especially when new servers need to be installed regularly, and not by the same person.

Currently I need to install about 30 packages via Yum (from large ones like mySQL to smaller 70KB random ones) Manually install a bunch of others (Python packages that are basically just "python setup.py install" commands) Create some directories, change some permissions etc.

What is the best way to create something that automatically does this. I can't always assume the client server has Yum, so would I need to download all the binaries and dependencies and have the script install them?

I know this is a loaded question. Does anyone know any good tutorials for this?

+4  A: 

You're asking a few questions at once, so I'm just going to touch on packaging and installing Python libraries...

Using setup.py you can turn Python packages into RPMs for installation on any Red Hat/CentOS box using yum. This is how I install all my packages internally at my job. Assuming the foundation rpmbuild utilities are installed, it's a simple as this:

python setup.py bdist_rpm

This will build an RPM of your package in the dist folder (e.g. dist/mypackage-1.01-1-noarch.rpm). Then you can just add this RPM to your internal yum mirror (if you have an internal mirror) and from there you can easily distribute packages to your internal hosts.

jathanism
+2  A: 

You can create an RPM package that depends on whichever packages you need.
http://fedoraproject.org/wiki/PackageMaintainers/CreatingPackageHowTo (For Fedora, but would be the same for RHEL/CentOS)

You would basically have a line in the .spec file like this:
Requires: mysql-server, httpd, php

So you can add this to your yum mirror (assuming you have one), then whoever is doing the installing can just do yum install server-setup and it'll automatically pull in all the required packages. As jathanism said, you can create RPMs from the setup.py scripts and put those on your mirror, and then just have your meta package depend on those RPMs.

And you could also do a Debian package if there is a possibility of a Debian system being used.

jonescb