Puppet: From Installation to Catalog Converge

2 hours
  • 6 Learning Objectives

About this Hands-on Lab

Jump in to the configuration management platform Puppet in this Learning Activity! Starting with installing Puppet, we aim to take you from newbie Puppet user to a competent module creator by installing and configuring Puppet Open Source, then by creating an Apache module where we’ll learn how to use resource types, add static files, create templates, use OS-specific parameters, and store data in Hiera. By the end of this learning activity, you’ll be ready to craft your own Puppet modules efficiently and with best practices.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create an `install` class

Create an install.pp manifest for the Apache class

Create a `service` class

Create a service.pp manifest for the Apache module

Create a `config` class

Create a config.pp manifest for the Apache module

Create a `vhosts` class

Create a vhosts.pp manifest for the Apache module

Create the `init.pp` file

Create an init.pp manifest that includes all previous classes

Run the Apache catalog against web1

Create a site.pp manifest for the production environment that runs the Apache class against the web1 agent

Additional Resources

Your employer has recently made the switch from another configuration management system to Puppet, and you're in the process of rewriting your end-state configurations to work with the new platform. Most paramount is the apache module, which you have been tasked with rewriting from scratch. Currently, the module must work with Red Hat, but the module should be set up with a params file so that it can quickly and easily be expanded in the future.

Since you do not currently have a Puppet testing environment, you must also install the Puppet Server and agent on the two provided servers intended for your environment. Set the Java arguments to use 512 MB RAM prior to installation.

The module requirements are as follows:

install.pp

  • Install httpd on CentOS 7 and ensure the package is present

service.pp

  • Ensure the httpd daemon is running and enabled
  • Allow for other classes to force a restart on the daemon

config.pp

  • Add the following static file to the file directory of the module:

    https://raw.githubusercontent.com/linuxacademy/content-puppetqs-nginx/learning-activity/httpd.conf
  • Ensure this file ends up at /etc/httpd/conf/httpd.conf on the agent

  • When changes are made to the file, force a restart of the httpd daemon

vhosts.pp

  • Create a virtual hosts template based on the following simple vhosts config:

    <VirtualHost *:80>
        DocumentRoot "/var/www"
        ServerName www.the-puppet-project.com
    </VirtualHost>
  • Set the port, document root, and server name to be Hiera variables

  • In the related manifest, ensure the document root exists

  • Use the server name the-puppet-project.com

init.pp

  • Ensure all classes are called
  • Ensure all variables are added to the class

When finished, add the apache module to the web1.ec2.internal server. Run a catalog converge on the agent server.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!
Thanks for reaching out!

You’ll hear from us shortly. In the meantime, why not check out what our customers have to say about ACG?