Issue
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?
Solution
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.
Answered By - jathanism Answer Checked By - Dawn Plyler (WPSolving Volunteer)