tlehman.blog >

Introduction to Puppet: Part 2

34 page views   |   400 words   |  
This post is all about running and refining the puppet manifest defined in part 1. That manifest defined a blog similar to this one.

You will need a VM before you start, here are a few options to pick from:
  • AWS LightSail VM (you can use any VM with a public IP available)
    • I'm using a 512 MB RAM, 2 vCPUs, 20 GB SSD, cheapest available.
      • Update: This is not enough ram to run bundler, which is what ruby uses to install all the dependencies that rails needs. Instead I am using a 2 GB RAM, 2 vCPUs, 60 GB SSD (free for first 3 months)
  • Linode
  • DigitalOcean
  • a local VM works, but only if you enable bridged networking, so that you can visit it's IP address on your host.

Steps

  1. Set up Puppet Agent host
  2. Install puppet
  3. Run 'puppet apply' and observe the results!
  4. ...
  5. Profit!

1. Set up Puppet Agent host

Once you have your VM up and running (I'm using LightSail), you should be able to ssh into it.
lightsail.png 58.5 KB
This will be the puppet agent that we run the manifest on.

You will want to set up a Static IP on that instance, so that you can access it from the internet.
staticip.png 27.4 KB


2. Install puppet


Here is the official documentation on installing puppet, but if you are using Ubuntu 22.04 (Jammy), you can do this:
wget https://apt.puppet.com/puppet8-release-jammy.deb
sudo dpkg -i puppet8-release-jammy.deb
sudo apt update
sudo apt install puppet

3. Run 'puppet apply' and observe the results!


Recall the puppet manifest from part 1, I made a gist here for convenience.

While running the puppet apply, I found an error in the manifest:
Error: Evaluation Error: Error while evaluating a Function Call, Could not find template 'modulename/nginx.conf.erb' (file: /home/ubuntu/blog_setup.pp, line: 12, column: 16) on node ip-172-26-10-216.us-west-2.compute.internal

This is because there is no Puppet Module named 'modulename'. We will fix this in Part 3. For now this will just cover the mechanics of running puppet apply, and getting an actionable error we can fix and then get closer to the finish line.

#puppet #programming