Is there a way to make an install image with your own custom packages installed?

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
xconfigurex
Posts: 10
Joined: 2013/07/15 19:42:51

Is there a way to make an install image with your own custom packages installed?

Post by xconfigurex » 2013/07/15 20:16:15

Hey,

I'm not certain if this should be in this forum, or general, however, this seemed the best place to start. I am looking to see if there is an established method for 3 things:

1. What is the easiest way to make an image of an existing CentOS 5.7 system, so that it can be re-deployed to many other machines via PXE boot?

2. Is it possible to have this image already contain pre-installed non-standard software that these machines would need to run?

3. Would kickstart be the easiest way to facilitate this? Or is there a better method?


In a nutshell, I am trying to create for an environment an easy way to reimage machines over the network, and when the image/install process is completed through this process, that they will be immediately ready for use. No further software/packages would have to be installed for the users to be able to start their work.

(The normal process is that each machine must be imaged from a DVD disc, and afterwards, a lot of special software/packages copied from over the network, and then installed. )

All of the machines have identical hardware, and all of the users are working on the exact same task/work. Not certain if it's relevant, but they are doing their work in the GUI, and also have VMplayer set up so that it can run a virtual windows 7 ultimate machine for testing purposes as well. It would be nice not to have to install that player and machine every single reinstall... thus I am looking into this process.

Lastly, it would be helpful if the PXE method somehow allowed for multiple images to be installed via a menu, or typed option.

That's about it, the server itself can really be anything, but would probably be best if it was also a CentOS machine as well.

Thanks! :)

XconfigureX

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Is there a way to make an install image with your own custom

Post by gerald_clark » 2013/07/15 20:26:42

5.7 is old and unsupported.
The current version is 5.9

You can use kickstart to install off the stock ISOs. Then do custom updates and installs in the %post phase.

You could also use configuration managers such as puppet.

xconfigurex
Posts: 10
Joined: 2013/07/15 19:42:51

Re: Is there a way to make an install image with your own custom packages installed?

Post by xconfigurex » 2013/07/16 13:11:41

Gerald, thanks for responding. I'll definitely look further into puppet now, as that seems a prudent suggestion. But I am curious, when you mean "post" phase, are you talking about after the install has totally finished? Or are you mentioning something that could be done with solely with kickstart? There are certain packages/scripts that would be nice to have already copied/installed when the process is complete. That way the new systems can be used immediately, without any further need for manual installation/configuration.

Also, I know 5.7 is unsupported and old, however, the user's development tools and scripts seem to only really work properly on 5.7, so they won't be upgrading anytime soon. They've stated they will only use this version, so it's something I have to work with.

Regardless, anyone able to answer those further points?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Is there a way to make an install image with your own custom packages installed?

Post by gerald_clark » 2013/07/16 13:51:28

Kickstart has different phases.
The %post phase allows you to run programs after all the selected packages have been installed.
This is where I ether install custom software or create a firstboot script
http://www.centos.org/docs/5/html/Installation_Guide-en-US/ch-kickstart2.html

xconfigurex
Posts: 10
Joined: 2013/07/15 19:42:51

Re: Is there a way to make an install image with your own custom packages installed?

Post by xconfigurex » 2013/07/16 15:56:47

Gerald, this has been great information so far, and it looks like kickstart "should" be able to do everything I need on the installation side. I'm reading through the doumentation you provided as well. I have a question though again about the %post section - can only scripts be run there? Or are you able to specifiy commands (with options) and have it run those, such as "yum -y update" for example.

I was thinking of having the software installs they need be done in the %post section.

Lastly, if I specifiy scripts/commands in order, will it execute those top to bottom queue style? Also, would it wait until the most current command/script is finished before attempting to execute the next one in line? If it does not, it will cause all sorts of failures, and I would have to figure out the wait statements.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Is there a way to make an install image with your own custom packages installed?

Post by gerald_clark » 2013/07/16 16:11:08

%;post runs chrooted to your installation, so what you can run depends on what you have installed.
The %post section runs as a bash script,

xconfigurex
Posts: 10
Joined: 2013/07/15 19:42:51

Re: Is there a way to make an install image with your own custom packages installed?

Post by xconfigurex » 2013/07/18 17:58:45

As a further question, is there any way to take an image of a system already running for say... a year, like with a ghost type utility such as clonezilla, or other, and then, have anaconda/kickstart deliver it to the target system upon request? This way it would skip needing to change the %post section after every tiny little configuration update. You'd just update the image, and replace the old one.

I thought I would ask as this would make life easier for both me, and my customer. If it can't be done through kickstart, but could be done another way via PXE boot, via http, nfs, ftp, or whichever delivery that would be good as well.

Post Reply