2

I want to learn puppet but I am confused with one thing.

I have already installed many python modules, apache modules, PHP plugins etc. Can I convert all that into puppet so that in my new server the puppet install them automatically?

I am confused how will that work. I don't remember which thing I installed or how I configured them. How do people do it?

mattdm
  • 6,740

3 Answers3

7

Sure, you can do that. I'd start small, and write puppet modules to cover one bit of the system at a time. Test that, then move to the next.

More ideally, you might want to try to replicate your existing system on a new server. Then, you'll be in much better shape.

As a general rule, you never want to have a system where no one knows what's there or how it got there.

mattdm
  • 6,740
1

I have a similar situation. We have just transitioned to a new CentOS 6.4 VPS and I wanted to re-create the environment in a local virtual machine.

  1. I installed VirtualBox, Vagrant and a clean CentOS 6.4 + Puppet install into it.
  2. Then I listed all of the installed software using yum list installed.
  3. I then created Yumrepo and Package entries in my Puppet init file for each package I cared about (I didn't do them all), using the version number as reported on the VPS.

Once all that was configured, puppet apply /path/to/init.pp gave me what I needed.

1

Puppet Labs has a fantastic VM that can be quickly spun up.
http://info.puppetlabs.com/download-learning-puppet-VM.html

It includes:

  • The puppet vim extension
  • Puppet pre installed
  • Web interface pre configured

Using the puppet learning VM allows you to make mistakes without worrying about causing damage you your production system.

It is possible to mess up your server if you aren't careful. See these examples of puppet going wrong

Can you unapply a puppet manifest action?
User can't log in after I manually set MD5 hash

spuder
  • 1,745