Skip to main content

Getting started with Puppet - Part 2 - Hello World

This is the second post in the series for getting started with Puppet. We are going to run a really simple Puppet module that is hosted on GitHub.

Tools needed:
Git client (of course)
VM or Nitrous.io or anything similar
Puppet client installed (discussed in Part 1)

Step 1: Download the Hello World module

git clone https://github.com/adityai/puppetStarter.git

Step 2: Run the Puppet hello world sample

cd puppetStarter
sudo puppet apply --modulepath . helloWorld/site.pp

This is how we apply a puppet module from the command line directly on the target machine or on your development workstation.

The output will have some information about verifying or compiling along with a message 'Hello World!"

➜  puppetStarter git:(master) sudo puppet apply --modulepath . helloworld/manifests/site.pp
Notice: Compiled catalog for ruby-on-rails-139787.us-west-2.compute.internal in environment production in 0.05 seconds
Notice: Hello World
Notice: /Stage[main]/Helloworld/Notify[Hello World]/message: defined 'message' as 'Hello World'
Notice: Finished catalog run in 0.04 seconds



➜  puppetStarter git:(master) sudo puppet apply --modulepath . helloworld/manifests/site.pp
Notice: Compiled catalog for ruby-on-rails-139787.us-west-2.compute.internal in environment production in 0.05 seconds
Notice: Hello World
Notice: /Stage[main]/Helloworld/Notify[Hello World]/message: defined 'message' as 'Hello World'
Notice: Finished catalog run in 0.04 seconds
➜  puppetStarter git:(master) sudo puppet apply --modulepath . helloworld/manifests/site.pp
Notice: Compiled catalog for ruby-on-rails-139787.us-west-2.compute.internal in environment production in 0.05 seconds
Notice: Hello World
Notice: /Stage[main]/Helloworld/Notify[Hello World]/message: defined 'message' as 'Hello World'
Notice: Finished catalog run in 0.04 seconds
Step 3: Take a look around. 
Observe the folder structure. The module folder is helloWorld. There are other default folders besides manifests inside the module that will be required for advanced topics. Try to understand the code in the init.pp, motd.pp and site.pp. We will dig into it in Part 3 and try to do something more fun.

Popular posts from this blog

Create #VirtualPrivateCloud, NAT Instance and NAT Gateways on @AWSCloud

Create a Virtual Private Cloud, NAT instance and the new NAT Gatweay ... and making it all work. This is a YouTube playlist of three videos.

Cheat sheet to create a #VPC and Subnets on @AWSCloud

One of the critical things to remember for working with a AWS VPC is creating and using it. I had hard time remembering how to do it, so, I wrote down a cheat sheet for myself.  If anyone wants to follow along, just navigate to the VPC page on the AWS Console and start with 'Create VPC' button. Please note that this may cost some dollars if you are not on the free tier. If you are on the free tier and make mistakes, it may cost some dollars. In the steps below, we will be creating the following on a new VPC: An internet gateway One public subnet with routes for accessibility from the internet One private subnet without any routes One EC2 web server with Apache installed in it and serving a sample html page - using the public subnet. One EC2 server with the private subnet and security group that allows access to resources running on the public subnet only.  Create VPC Name tag: myVPC CIDR Block: 10.0.0.0/16 Tenancy: default (Must have default. Otherwise, i...

Trying @teamcity for #ContinuousIntegration - Part 1

Teamcity is a continuous integration software application from JetBrains . I am a Jenkins expert. I use it at work and I go deep into it with custom plugins and custom code to orchestrate builds and deployments. I use CircleCI and TravisCI for my github projects and these are just for fun. All these products are good in their own way. Jenkins is the mother of all CI tools. CircleCI and TravisCI are simpler to use and I really like the speed and agility of these tools. I would use Jenkins for enterprise and CircleCI/TravisCI for open source public domain projects. I didn't realize that there is a free version of Teamcity until last night and the features are fairly decent. There is a 50% discount for startups and free for open source projects. This is welcoming. Installation Jumping right into it. I downloaded the windows version and the installation was fairly simple with the executable, but I could not get it to work. The browser would just show a blank page. I qu...