Managing infrastructure with Puppet Enterprise
PE is mainly used to automate and deliver infrastructures and complex workflows. So, it is essential to understand how infrastructure is managed in PE. To understand infrastructure management, you need to follow three main topics.
- Managing Nodes.
- Orchestrating Puppet and Tasks.
-
Managing code with Code Manager.
We will see these three topics one by one in this article. So, let’s begin.
Managing Nodes
Nodes are the basic blocks of PE. You can perform many operations on nodes and configure them according to your needs. This section of the article will discuss the various management operations you can perform on nodes.
Adding and Removing Agent Nodes
You can easily add the nodes you require and remove the ones that are no longer needed. To add a node, install a puppet agent on the node; this automatically sends a certificate signing request (CSR) from the node to the primary server. Then you must accept the request to make PE run on the node and make it available throughout the console.
You can remove the node as quickly as you have added it. When you remove a node, it is deleted from the PuppetDB and can no longer be available in the console. The certificate assigned to this node will become free and can be used by other nodes.
Adding and Removing Agentless Nodes
It is not necessary to always install a puppet agent on a node to manage it in the PE console. You can also use the inventory service to manage nodes or services. In this case, the nodes and device information are stored in the PE inventory. The information stored is secure and reliable.
How are the Nodes Counted?
You can also count the number of nodes present in your PE inventory. You can add a limited number of nodes to your inventory. Your PE license specifies this limit as the bursting limit. You must purchase a license or remove the unnecessary nodes to add more to your inventory.
Running Puppet on Nodes
PE automates the process of running Puppet on nodes. The PE runs on each node in a fixed interval of 30 minutes. You can also run on the nodes outside this 30-minute interval by manually triggering a Puppet run.
Grouping and Classifying Nodes
The grouping and classification of nodes make management easier. Multiple nodes can be managed together as a whole. This can be done by configuring nodes and assigning them classes, parameters, and variables.
Making Changes to Node Groups
PE also provides the ability to make changes in the node groups. By making the changes in the node groups, the change is made on all the nodes present in the group. You can remove nodes or classes from a node group. You can also edit the parameters and variables assigned to the node groups.
Preconfigured Node Groups
PE offers some preconfigured node groups. You can use these node groups for configuring your PE infrastructure. It saves the efforts of defining or creating common node groups.
Designing System Configurations (Roles and Profiles)
PE helps develop the complete system configuration. This includes all the necessary software, services, and configuration elements that are needed by your system. Managing roles and profiles is one of the most critical tasks regarding system configuration. You can build more reconfigurable and reusable systems if the roles and profiles are correctly configured.
Endpoints
PE also manages various endpoints. You can configure and manage the below-mentioned endpoints.
- Node Classifier API v1.
- Node Classifier API v2.
-
Node Inventory API v1.
Now, let's move on to the second section of this article.
Orchestrating Puppet and Plans
The next thing on our list is orchestrating the puppet runs, tasks, and plans. It helps in making on-demand changes in your PE infrastructure. It allows us to automate the work, reducing manual effort.

How does Puppet orchestrator work?
The Puppet orchestrator, as discussed earlier, is used to run Puppet, tasks, and plans.
When you run Puppet with an orchestrator, you can decide the rollout of configuration changes and how and when you need them. You control when Puppet runs, so you do not have to wait for the fixed time intervals to update the nodes.
With puppet tasks, you can execute actions on desired machines. A task is a single action you can perform on any desired machine.
Puppet plans are collections of tasks that perform a specific function. They are used to perform complex operations by combining more straightforward tasks.
Setting up the Orchestrator Workflow
The orchestrator is used along with other PE tools to allow you to control when and how to make the changes in the infrastructure before hitting the production environment.
Configuring Puppet Orchestrator
Once you have installed PE, you need to perform some tasks to make your infrastructure ready for orchestration services. Following are the functions that you need to perform.
- Configure Puppet orchestrator's PE RBAC(role-based access control) permissions and token authentication.
-
Examine the orchestrator configuration files and make the necessary changes.
Run Puppet on demand
You can run jobs in PE via orchestrator as and when you need. You can run those jobs on demand in several ways. It can be from
- The console.
- The command line.
-
via Orchestrator API endpoints.
Tasks in PE
With puppet tasks, you can execute actions on desired machines. A task is a single action you can perform on any desired machine. You can run a task from the command line or the console.
Plans in PE
Puppet plans are collections of tasks that perform a specific function. They are used to perform complex operations by combining more straightforward tasks. They not only combine tasks but also combines commands, scripts, and other plans to create complex workflows.
Orchestrator API v1
There are various functions performed by orchestrator API v1. You can
- Run plans and jobs on demand.
- Get details about plans, jobs, and events.
- Track the node usage.
-
Schedule tasks and plans.
Now we have reached the last part of the article.
Managing code with Code Manager
The Puppet code is automatically managed and deployed with the help of Code Manager. The code manager ensures that the puppet code is uploaded to the primary servers and the compilers. It ensures that the updated code is synchronized with the production repository and is executed as soon as available. It is also the responsibility of the Code manager to make sure that the execution of new code does not interrupt the in-progress agent runs.

How does Code Manager work?
It is necessary to synchronize the puppet code in the production repository, and to do so; Code manager uses r10k and the file sync service. This allows the Code manager to stage, sync, and manage the new code. It also automates the management and deployment of puppet code.
Set up Code Manager
Setting up the code manager to perform the code management services in your PE is necessary. To do so, you need to install Code manager.
Configure Code Manager
You have to enable Code manager in your PE to configure it. After this, you must set the authentication and test the connection between the code manager and the production repository.
Code Manager API
The code manager API allows you to deploy code on your primary server and compilers without direct shell access. You can also use the Code manager API to check the status of the deployment of your puppet code.
About File Sync
Code manager uses the File sync service to synchronize the new code with your production repository. It also ensures that the code is synchronized with the primary servers and compilers.
Frequently Asked Questions
What is Puppet?
Puppet is a software configuration management tool. It is a platform to configure the system and software settings. Puppet has its declarative language to manage the settings. You do not need much knowledge of programming to use Puppet.
How to ensure if Puppet is installed on the system or not?
To ensure that Puppet is installed or not in your system, run the command puppet-V. If it gives an output with some version of Puppet, that means Puppet is installed; else not.
What is Puppet Enterprise?
Puppet Enterprise is a commercial version of Puppet developed on top of the open-source Puppet platform. It makes the automation and delivery of infrastructure and complex workflows more accessible.
What does a code manager do in PE?
The code manager ensures that the puppet code is uploaded to the primary servers and the compilers. It ensures that the updated code is synced in the production repository and is executed as soon as available.
What are the tasks and plans in PE?
A task is a single action you can perform on any desired machine. A plan is a collection of tasks that perform a specific function. They are used to perform complex operations by combining more straightforward tasks.
Conclusion
This article discussed managing infrastructure in Puppet. We discussed managing nodes, Orchestrating Puppet and plans, and managing code with the code manager in PE. To get started with Puppet, visit Installing and Configuring Puppet Enterprise.
I hope you would have gained a better understanding of these topics now! Are you planning to ace the interviews with reputed product-based companies like Amazon, Google, Microsoft, and more?
Attempt our Online Mock Test Series on Coding Ninjas Studio now!
Happy Coding!