Centos – Installing software the first time a system boots after CentOS installation

.rccentossoftware installationstartup

I have a custom text based CentOS 6.4 installation that installs the OS, then after the first boot I have a custom rc.local file that installs custom applications and prepares the system for our customers. When this install completes, the original rc.local that came with the OS is copied back into place for normal operation.

This has worked fine for years but would like to know if there is a better way to install software after the first boot? OR … Is this the best way to install additional applications after the OS is installed?

Best Answer

These days automated provision and configuration management (which includes installed software) has evolved greatly.

To provision a CentOS machine I would typically:

  • register a new system in cobbler
  • create a A/AAA DNS entry, a host entry and a puppet service entry for this host in FreeeIPA
  • PXE boot the machine (virtual or physical, the method applies)
  • Sit back and relax.

For this to work, though, I have previously:

  • created a kickstart file/template in cobbler for this system, or profile of systems.
  • ensured that a local mirror exists for all the repositories I'm going to need (not mandatory, but very helpful)
  • defined all the configuration that applies to this host in the puppetmaster
  • defined all the information related to sudo rules, HBAC, ssh key management, SELinux user mappings, etc in the Identity Manager.

This infrastructure provides centralized services, and a reproducible, (almost) unattended way of installing a machine.

If your puppet code is optimized, you will end up with a system containing all the software you consider necessary for a host before the first boot.

Related Question