Running Puppet HelloWorld on CentOS 6.3

Puppet is a very well-known configuration management tool that has been adopted by many enterprises and service providers. VMware recently invested $30M in Puppet Labs, the company behind it. It’s clear that VMware needs such a tool if it wants to grow in data center space.

I actually got a book from last year’s PuppetConf in San Francisco and browsed through it on my flights. As with any other technology, reading it does not mean getting it. To get my hands dirty, I played with it in my home lab last week.

Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.

Believe it or not, there are many pages on the Web but very few of them are update to date or accurate. The following are the steps for creating a simple HelloWorld type of example that I had gone through with a few glitches. Hope it works for you too. To its simplest form, the example does not leverage the client/server model but simply show the idea with standalone node.

The starting point of using Puppet is an operating system, be it Linux, Solaris, or Windows. I just picked CentOS as I happened to have a virtual machine template of CentOS 6.3.

Part 1: install puppet and pre-requisites

# rpm -Uvh <a href="http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-6.noarch.rpm">http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-6.noarch.rpm</a>
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum -y install puppet

Part 2: create a simple module with two files.

# mkdir -p /etc/puppet/modules/helloworld/manifests
# vim /etc/puppet/modules/helloworld/manifests/init.pp

Enter the following code.

class helloworld {
	file { ‘/tmp/helloworld’ :
		content => “See you at doublecloud.org”
	}
}

Continue with second file calling the first one.

# mkdir -p /etc/puppet/modules/helloworld/tests
# vim /etc/puppet/modules/helloworld/tests/init.pp

Enter the following code in editor.

class { 'helloworld': }

Part 3: apply the configuration with a command.

# puppet apply /etc/puppet/modules/helloworld/tests/init.pp

Part 4: Check if the configuration has been applied.

# cat /tmp/helloworld

Now your first Puppet example works. Next is to use Puppet in distributed fashion [Client/Server Mode] which is the norm in real projects.

This entry was posted in Cloud Computing and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

5 Comments

  1. Posted February 13, 2013 at 12:44 am | Permalink

    Running Puppet HelloWorld on CentOS 6.3 (DoubleCloud) http://t.co/KQfKtMp1

  2. Posted February 13, 2013 at 1:03 am | Permalink

    Running Puppet HelloWorld on CentOS 6.3 (DoubleCloud) http://t.co/9nJzz3ih

  3. Posted February 19, 2013 at 1:47 pm | Permalink

    Running Puppet HelloWorld on CentOS 6.3 http://t.co/DFW2x5XJ via @sjin2008

  4. Posted March 6, 2013 at 2:02 am | Permalink

    Well explained, thnx

  5. Posted October 21, 2013 at 3:32 pm | Permalink

    Thanks, Steve! Nice!

    One note: I was necessary in my Ubuntu Linux, Puppet 3.1 environment to straighten the curly single and double quotes in the Part 2 example code …

2 Trackbacks

  • By Tofa IT » Running Puppet HelloWorld on CentOS 6.3 on February 13, 2013 at 5:24 am

    […] if it wants to grow in data center space. I actually got a book from last year’s PuppetConf […]Running Puppet HelloWorld on CentOS 6.3 originally appeared on DoubleCloud by Steve Jin, author of VMware VI and vSphere SDK (Prentice […]

  • By Running Puppet in Client/Server Mode | DoubleCloud.org on February 20, 2013 at 11:16 pm

    […] my last post, I introduced how to run a very simple HelloWorld script with Puppet 3.1.0 on CentOS 6.3. Although […]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.