Ora

Is Puppet Push or Pull?

Published in Configuration Management 3 mins read

Puppet primarily operates on a pull model for configuration management. This means that client nodes initiate contact with the server to retrieve their desired state.

Understanding Puppet's Pull Model

In the Puppet ecosystem, the fundamental mechanism involves a Puppet agent running on each managed client node and a Puppet master server. The workflow is as follows:

  1. Agent Initiation: The Puppet agent on a client node periodically contacts the Puppet master. By default, this check-in happens every 30 minutes, though it can be configured.
  2. Fact Submission: During this check-in, the agent sends "facts" about the node to the master. Facts are data points like the operating system, IP address, installed memory, and other system characteristics, gathered by tools like Facter.
  3. Catalog Compilation: The Puppet master uses these facts, along with its defined manifests (Puppet code) and environment settings, to compile a "catalog" specifically for that node. The catalog is a JSON document describing the desired state for the node.
  4. Catalog Retrieval: The agent pulls this compiled catalog from the master.
  5. Configuration Enforcement: The Puppet agent then applies the instructions in the catalog to enforce the desired configuration on its local system, making any necessary changes to bring the node into compliance. It also reports the outcome of this run back to the master.

This client-driven approach ensures that nodes actively maintain their intended state, regularly checking for updates or deviations from the defined configuration.

Pull vs. Push: A Comparative Overview

While Puppet leverages a pull model, other configuration management tools, such as Ansible, often employ a push model. Understanding the differences clarifies why Puppet opts for the pull approach.

Feature Puppet (Pull Model) Ansible (Push Model)
Initiation Client (agent) initiates connection to the server. Server (controller) initiates connection to nodes.
Agent Requirement Requires a Puppet agent daemon running on client nodes. Agentless; typically uses SSH or WinRM for communication.
Operational Flow Nodes periodically check in and pull their configuration. Server pushes configurations directly to nodes on demand.
Deployment Speed Eventual consistency; changes applied at next agent check-in. Instantaneous deployment for immediate execution.
Scalability Generally scales well as agents distribute connection load. Can be efficient for smaller to medium environments; large fleets might require careful architecture.
Primary Use Case Maintaining a desired state over time (state enforcement). Ad-hoc task execution, immediate configuration changes, orchestration.

Benefits of Puppet's Pull Architecture

Puppet's pull model offers several advantages for maintaining infrastructure at scale:

  • Self-Healing Capabilities: Agents continuously enforce the desired state. If a configuration drifts due to manual intervention or other processes, the agent will revert it to the specified state during its next run.
  • Scalability: By having agents initiate connections, the load on the Puppet master can be distributed over time, as not all agents check in simultaneously.
  • Autonomy: Nodes are responsible for managing their own state, reducing the need for constant, active management from a central server.
  • Reduced Network Congestion: Agents only pull the necessary catalog, and network traffic is generally consistent and predictable.

Practical Implications

For system administrators and DevOps teams, the pull model means that once a Puppet manifest is deployed to the master, it will eventually be applied across all relevant nodes without manual intervention. This allows for robust, desired-state management, making it ideal for maintaining a consistent and compliant infrastructure over time. While tools like Puppet Bolt can offer push-like capabilities for ad-hoc commands, the core configuration management functionality of Puppet relies on the agent's periodic pull from the master.