Using Puppet Orchestrator

Hands-On Lab

 

Photo of Elle Krout

Elle Krout

Content Team Lead in Content

Length

00:15:00

Difficulty

Beginner

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.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Using Puppet Orchestrator

Introduction

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

Solution

Begin by logging in to the lab server using the credentials provided on the hands-on lab page:

ssh cloud_user@PUBLIC_IP_ADDRESS

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] { facts.os.name = "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

Conclusion

Congratulations — you've completed this hands-on lab!