Dissecting Puppet's architecture from the inside: the agent run flow from Facter gathering facts, SSL certificate authentication, catalog compilation on the server, to reporting to PuppetDB along with its ten main components.

In the previous episode 1, you understood the history of configuration management and why Puppet exists — from the era of manual scripting to the complete ecosystem it brought. Now it's time to dissect Puppet's main architecture: how a simple manifest can keep thousands of nodes converged. This is the most fundamental episode in the series, because almost every advanced topic — Hiera, PuppetDB, Roles/Profiles, and even Puppet Enterprise — is rooted in this architecture.
Every node managed by Puppet runs an agent run periodically (default 30 minutes). One agent run cycle consists of six stages:
Node Server PuppetDB
| 1. node facts | |
|--------------------->| |
| 2. SSL handshake | |
|--------------------->| |
| 3. catalog compile | |
| (manifest + data) | |
| | |
| 4. catalog sent | |
|<---------------------| |
| 5. agent applies | |
| 6. result report | |
|--------------------->|-------------------->|Note
The facts gathered by Facter help determine the catalog. That's why nodes with different operating systems can receive different catalogs from the same manifest — this is the foundation of data-driven configuration that Hiera will later strengthen.
Before an agent first receives a catalog, it must introduce itself through a certificate. The authentication flow:
sudo puppetserver ca sign --certname agent.example.comPuppet is a set of components that work together. Understand each role:
| Component | Role | Where it runs |
|---|---|---|
| Puppet Server | Compiles catalogs from manifests | Central server |
| Puppet Agent | Applies the catalog on every node | Every node |
| PuppetDB | Stores facts & reports | Server (optional) |
| Manifest | Configuration source code | Module directory on the server |
| Resource type | System element abstraction (package, service, file) | Written in manifests |
| Class | A named collection of resources | Written in manifests |
| Module | A package of manifests, templates, files, and data | Module directory on the server |
| Node classification | Determines which class goes to which node | File or classifier |
| Hiera | Configuration database separate from logic | Server |
| Facter | Node fact collector | Every node (agent) |
Puppet Server is the control center. It stores manifests, reads node classification, pulls data from Hiera, and compiles catalogs — one for each node, based on its facts and classification. It also acts as the Certificate Authority (CA) that manages all agents' certificates.
The agent is the process running on every managed node. On a schedule (default 30 minutes), the agent fetches a catalog from the server, compares it with the actual state, then applies the changes. The agent also runs Facter to gather facts.
PuppetDB is the centralized data store. All facts and agent run reports are stored here, so you can answer questions like: which nodes still run an old OS, or how many nodes failed last night. PuppetDB also supports exporting data to other tools.
A manifest is a file containing Puppet configuration code. This is where you write resource types, classes, and node settings. Manifests use the .pp extension (Puppet Program).
A resource type is an abstraction of a system element: package, service, file, user, group, cron, and more. Each resource has a title for identification and parameters that define its properties.
package { 'nginx':
ensure => '1.18.0',
}A class is a named collection of resources that can be reused. Classes let you write a configuration once and apply it to many nodes — this is the core idea behind modules.
A module is a structured package containing manifests, templates, files, and Hiera data. Modules can be downloaded from Puppet Forge or written by yourself. We'll dissect the internal module structure in episode 5.
Node classification determines which classes are applied to which nodes. There are several mechanisms: the site.pp file on the server, Puppet Enterprise's built-in classifier, or Hiera data. The goal is one — mapping nodes to configurations.
Hiera is a hierarchical database that separates data from logic. Instead of writing configuration values inside manifests, you store them in Hiera and access them via lookup. This allows one class to serve thousands of nodes with different values per environment.
Facter is the fact-gathering tool that runs on the agent. Facts like os.name, networking.ip, and memory serve as input for catalog compilation. With facts, a single manifest can produce different catalogs for different nodes.
Tip
Facter can be run manually to explore node facts. Try facter --puppet on your test node and compare the output with puppet facts — you'll see how much information is available for making configuration decisions.
In this episode 2, you understood Puppet's architecture from top to bottom: the six-stage agent run flow that starts with Facter gathering facts, SSL certificate authentication, catalog compilation on the server, through to reporting to PuppetDB — plus the ten main components that work together as one unit.
Key takeaways:
In the next episode, episode 3, we'll get hands-on — setting up and installing Puppet Server and agents from the official repos, configuring DNS and certificates with puppet ssl bootstrap, running your first puppet agent -t, and comparing Puppet OSS with Puppet Enterprise. Prepare your nodes, because now it's time to take action!