Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Using Puppet Classification

The process by which we map our classes, variables, and parameters to our nodes is known as classification. In Puppet Enterprise (PE), we have the option to assign our nodes to groups and classify our nodes by leveraging the PE Console. Additionally, groups can be associated with a parent group, and the child group will inherit all classes alongside parameters. The overall process gives us the ability to create layered groups and systems that we can assign to our nodes based upon the designated purpose it serves within our infrastructure. Moreover, we can assign groups to the component module or use them in conjunction with roles and profiles. In this hands-on lab, we will create a parent `web` group with two children: one for our general website and one for our web app. We will include core modules in the `web` parent, override, and then expand our requirements in each of our child groups.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 15m
Published
Clock icon Aug 02, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Prepare Test Nodes

    1. Bring both additional nodes under Puppet's control by logging in via SSH and running:

      curl -k https://puppet.ec2.internal:8140/packages/current/install.bash | sudo bash
      
    2. Access the Puppet Enterprise console at https://PUBLIC_IP and log in as admin with the password pinehead.

    3. Click Unsigned certs on the left-hand side menu.

    4. Click the Accept All button to accept our nodes.

  2. Challenge

    Create the Groups

    1. Click Classification on the left-hand side menu.
    2. On the Classification page, click Add group..., and then set the following values to create the Web group:
      • Parent name: All Nodes
      • Group name: Web
      • Environment: production
    3. Click Add.
    4. Repeat the above process to create the Website group, except the following value will differ:
      • Group name: Website
    5. Click Add.
    6. For the final Webapp group, set the following values:
      • Parent name: Web
      • Group name: Webapp
      • Environment: production
    7. Click Add.
  3. Challenge

    Configure the Web Group

    1. On the Classification page, click on the Web group, and then the Configuration tab.

    2. Set Add new class to the apache class via a search.

    3. Click Add class.

      Note: We may need to click Refresh for all classes to be visible.

    4. Click the Commit 1 change button to save the changes.

  4. Challenge

    Configure the Website Group

    1. Click Classification on the left-hand side menu.
    2. Expand the Web group, and click Website.
    3. Under the Rules section, set the following values:
      • Fact: fqdn
      • Operator: ~
      • Value: website

    Note: Changing the operator field to ~ensures that partial matches will work.

    1. Click Add rule.

    2. Click the Configuration tab.

    3. Add the apache::vhosts class via a search in the Add new class section.

    4. Click Add class.

    5. Under the apache::vhosts class, select the vhosts parameter name.

    6. In the Value section, we need to write our virtual hosts parameters as a hash, replacing what would traditionally be hashrockets with colons:

      {"puppet-project":{"port":"80","docroot":"/var/www/puppet-proj"}}
      
    7. Click Add parameter.

    8. Scroll down to the Data section, and set the following values:

    • Class: apache
    • Parameter: default_vhost
    • Value: false
    1. Click Add data.
    2. Click Commit 3 changes.
  5. Challenge

    Configure the Webapp Group

    1. Click Classification on the left-hand side menu.

    2. Expand the Web group, then click Webapp.

    3. Under the Rules section, set the following values:

      • Fact: fqdn
      • Operator: ~
      • Value: app

      Note: Changing the operator field to ~ ensures that partial matches will work.

    4. Click Add rule.

    5. Click the Configuration tab.

    6. Add the apache::vhosts class.

    7. Under the apache::vhosts class, select the vhosts parameter name.

    8. In the Value section, we need to write our virtual hosts parameters as a hash, replacing what would traditionally be hash rockets with colons:

      {"marionette":{"port":"8081","docroot":"/var/www/marionette"}}
      
    9. Click Add parameter.

    10. Add the java class.

    11. Select the distribution parameter, and then set the value to jre.

    12. Click Add parameter.

    13. Click Commit 3 changes.

  6. Challenge

    Test the Group Settings

    For each node, perform the following:

    1. In the Puppet Enterprise console, click Nodes on the left-hand side menu.
    2. Select the desired node.
    3. Click Run Puppet, and then select Run.
    4. We can also click View report to see a detailed breakdown of the changes that were applied.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

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.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans