1

I am working on building a new virtual machine with CentOS installed on it. It takes a lot of time to setup and build servers to include all of the hardening steps, service changes, custom monitoring scripts, etc. To this end, I was curious if there was a way to define a template of the base server install that could be used to spin off copies of other servers of the same type? Additionally, if I can a core server template, is there a way to say add the configuration pieces for a web server or a database server and build that new server such that you would have core template + database template = new server? I hope that this makes sense.

3
  • There was a comment on here for something called Anaconda? I would be interested in seeing that comment again if it could be added back.
    – John
    Jan 3, 2012 at 20:52
  • 1
    This is a completely virtual environment? Why not just duplicate/clone the disk/VM after you have set it up to meet your requirements?
    – Tim
    Jan 3, 2012 at 20:54
  • @John Anaconda is the Red Hat/CentOS installer. Kickstart is the automation/scripting of Anaconda. Refer to the documentation here: wiki.centos.org/TipsAndTricks/KickStart. Since you are virtualized though, a combination of Kickstart+templating/cloning may get you what you need. More robust configuration management such as the below answers (Puppet/Chef/Salt) may help with long term support as well as provisioning. Jan 3, 2012 at 22:31

3 Answers 3

4

What you're looking for is a configuration management system - Puppet or Chef are the big ones these days.

They'll let you define a "base" configuration with all of your boilerplate hardening steps, services, and configurations, as well as defining configurations to go beyond the baseline with specific applications and services assigned (then automatically installed and configured) to specific nodes.

Combine this with a good kickstart configuration for automatically getting the OS installed and to the point where it's being managed by your configuration system, and you can take a whole lot of manual labor out of the provisioning process.

2
  • Thanks for the information. Is Puppet or Chef able to be used on VM's or within a virtualized environment? What about something called Spacewalk?
    – John
    Jan 3, 2012 at 20:50
  • 2
    Puppet & Chef work perfectly in a virtualized environment. There are no difference between VMs or physical host at the configuration level. Spacewalk is the equivalent of Redhat's Satelite. You should also look into Cobbler to kickstart environmnent (pre-puppet) Jan 3, 2012 at 20:56
3

blueprint will reverse-engineer a Linux installation and spit out a nice shell script (or Puppet/Chef config, if you prefer) for spinning up a new copy of that setup.

1

The way that I set things up is I have a cobbler system that manages PXE environment. Cobbler makes a kickstart file that installs a base OS and pre-selected packages. One of my pre-selected packages is a configuration management system (I use salt) that then does additional configuration and makes sure the machines stay in a known state.

I too used to loath to setup new servers (physical or virtual) and would forget to do something or skip over a step in our documentation. However once I got cobbler and salt set up new server setup was a breeze and is done in minutes not hours. I can also be sure that my servers are always the way that they should be and have a way to get them back to exactly that state quickly if needed.

Regardless of what system you choose (puppet, chef, salt) it will save you time in the long run.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .