Using Puppet Orchestrator

15 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Puppet Enterprise’s orchestrator allows us to perform on-demand Puppet runs across our node, plus execute various prewritten tasks on targeted nodes. This process essentially grants us more control over _when_ our modules are applied, and _when_ tackling the circumstances they’re faced with at the time of being added. Similarly, as we orchestrate actions via Puppet tasks, we can fine-tune our managed nodes without having to log in to the CLI.

In this hands-on lab, we’ll be using the Puppet orchestrator to trigger a Puppet run on a provided node, and then use tasks to install and kickstart a wide array of packages on our host.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Prepare the Ubuntu Node
  1. Bootstrap the Ubuntu node with the following command:

    curl -k https://puppet.ec2.internal:8140/packages/current/install.bash | sudo bash

  2. Approve the node through the master, either through the PE console or command line:

    sudo puppetserver ca sign –all

Perform a Puppet Run Against the Ubuntu Node
  1. Select Puppet from the left-hand side main menu.

    Note: A job description entry, such as Puppet run dry run is optional, but recommended.

  2. Leave the default value for Environment at Run nodes in their own assigned environment.

  3. Select No-op for applying noop mode as the Run Mode to launch an initial test run.

  4. Set up the Inventory list so that the target is set to PQL query.

  5. Click the Common queries dropdown to select Nodes with a specific fact and fact value option that will allow us to search for our Ubuntu-based node:

    inventory[certname] { = "Ubuntu" }

  6. Click Submit query.

  7. Click Run job, ensuring that the Puppet run succeeds on the node.

  8. Repeat the process, but do not run the job in noop mode this time by ensuring that No-op is not selected.

Use Tasks to Install PHP and Restart Nginx
  1. Select Task from the left-hand side menu pane.

  2. Select the package task from the dropdown.

    Note: A job description, such as Install PHP, is optional.

  3. Update the task parameters so that the following values are set up:

    • action = install
    • name = php
  4. Under Schedule, ensure that the runtime for the job is set to Now.

  5. Under Inventory, select the same node from the previous section by choosing the Node list option, and then for the Add nodes section ensure that node1.ec2.internal is selected.

  6. Click Run job.

  7. Once the job completes, repeat this process, except use the service this time and apply task parameters with the following values:

    • action = restart
    • name = nginx

Additional Resources

You work as a DevOps engineer for a small web hosting company. Recently, they have begun to consider making greater use of orchestration while configuring certain nodes. Having said this, not many people on the team have an extensive amount of experience with Puppet beyond the configuration management side. Therefore, you are tasked with setting up a test node and performing basic orchestrator tasks on it that will give you a sense of the feature's overall capabilities.

First, bootstrap the provided Ubuntu node:

curl -k https://puppet.ec2.internal:8140/packages/current/install.bash | sudo bash

Next, log in to use the PE Console with the username admin and password pinehead.

Then, orchestrate a Puppet run on all of the Ubuntu nodes.

Once completed, explore the use of tasks by installing the php package on the same nodes as above, and then restart the nginx service, also through the use of a task.

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?