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,600
  • 1
  • 26
  • 48
MOtaro Site
  • 213
  • 2
  • 4
  • 13
  • 1
    "I don't remember which thing I installed or how I configured them." - Check your Yum log for installed packages. Check which configuration files differ from what's provided by the package. (`rpm -Va`) Look for files newer than the install/provision date. It's going to be painful. But, you go through this once and you learn to maintain documentation. – Aaron Copley Jul 19 '13 at 14:31
  • You're really going to be glad you started down this path. Whether you use puppet, chef, ansible, sprinkle, etc. There's always friction at the start, but once you start automating, you're going to love what it does for you. – platforms Jul 24 '13 at 00:33

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,600
  • 1
  • 26
  • 48
  • I am thinking the same , i have one amazon ec2 instance fully working. i will start from there and then try to build same server slowly untill i reach there. how should i start. i mean should i get the book of `puppet 3` or `2.7` because 2.X has many books but `3` has less books. i dont know how much is the difference – MOtaro Site Jul 19 '13 at 02:45
  • 2
    @MOtaroSite Start with 3. Most of the learning materials from 2.x are still applicable to 3 (the main difference is the scoping changes, be aware of them), and you won't have to deal with the headache of converting anything. – Shane Madden Jul 19 '13 at 02:52
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,725
  • 3
  • 26
  • 42