Skip to content
Tutorials Center
My learning

Topics

Puppet Tutorial

Learn Puppet step by step: 38 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Puppet? Learn what Puppet is, what problem configuration management solves, how Puppet describes servers in code, and what you will build in this course.
  2. 2 Declarative, Idempotent, and Puppet Compared Understand declarative versus imperative configuration, idempotence and convergence, and see how Puppet compares with Ansible, Chef, Salt and plain shell scripts.
  3. 3 Your First Puppet Run with puppet apply Install the Puppet agent, write a first manifest and run it with puppet apply, using --noop, --test and --debug to see what Puppet would change.
  4. 4 Puppet Editions, Versions, and Terms Sort out Puppet open source, Puppet Enterprise and OpenVox, how versions and platforms work, where files live, and the vocabulary (node, catalog, fact, module) used everywhere.

Architecture and Setup

  1. 5 Puppet Architecture: Server, Agent, and Catalog Learn how Puppet Server, agents, Facter, catalogs, reports and PuppetDB fit together, and what happens on the network during one agent run.
  2. 6 Installing Puppet Server and the Agent Step-by-step plan to install Puppet Server and puppet-agent on Linux, set the server name, start services, open port 8140 and connect your first node.
  3. 7 Certificates and Node Authentication Learn how Puppet's built-in certificate authority authenticates nodes: CSR, signing with puppetserver ca, autosign policies, revoking and cleaning certificates.
  4. 8 The Agent Run Lifecycle Follow one Puppet agent run from pluginsync and facts to catalog compile, apply and report. Learn runinterval, splay, noop mode, cached catalogs and common run failures.
  5. 9 Environments and puppet.conf Use Puppet environments to separate production, staging and development code, understand the environment directory layout, environment.conf, and the puppet.conf sections.

Manifests and Resources

  1. 10 Resources and Resource Types Master Puppet resources: declaration syntax, titles and namevars, the core types file, package, service, user, group and exec, ensure, and resource defaults.
  2. 11 Variables and Data Types Learn Puppet variables and scope, strings and interpolation, numbers, booleans, arrays, hashes, undef, the type system with Optional, Enum and Pattern, and the facts hash.
  3. 12 Conditionals and Operators Write platform-aware Puppet code with if, unless, case and selector expressions, comparison, boolean, in and regex operators, and avoid the classic truthiness traps.
  4. 13 Resource Relationships and Ordering Control Puppet resource order with require, before, notify, subscribe and chaining arrows, understand the dependency graph, refresh events, autorequire and avoid cycles.
  5. 14 Iteration, Functions, and Lambdas Loop in Puppet with each, map, filter, reduce, slice and with; declare resources from arrays and hashes, use built-in functions, and understand why Puppet has no for loop.

Classes, Modules and Hiera

  1. 15 Classes and Parameters Group resources into Puppet classes, declare them with include or resource-like syntax, add typed parameters with defaults, and understand automatic data binding and contain.
  2. 16 Defined Types Create reusable multi-instance building blocks with Puppet defined types: define syntax, $title and $name, parameters, avoiding duplicate resources, and when to use a class instead.
  3. 17 Module Structure and the Puppet Forge Organise Puppet code into modules: directory layout, autoloading names, files, templates, metadata.json, installing from the Puppet Forge, and writing a first small module.
  4. 18 Hiera: Data Separated from Code Keep data out of Puppet code with Hiera 5: hiera.yaml hierarchy, YAML data files, automatic parameter lookup, the lookup function, merge strategies and encrypted secrets.

Facts and Templates

  1. 19 Facter and Core Facts Learn how Facter collects facts about each node, how to read the structured $facts hash in manifests, and how to branch on operating system, memory and network data.
  2. 20 Custom and External Facts Extend Facter with custom Ruby facts, executable and text external facts, and facts.d files. Learn pluginsync, fact precedence, caching and how to avoid slow facts.
  3. 21 EPP Templates Generate configuration files with Puppet's EPP templates: declare parameters, use tags, loops and conditionals, trim whitespace, call epp() and inline_epp() safely.
  4. 22 ERB Templates and Legacy Code Read and maintain Puppet's older ERB templates: the template() function, @variables, scope lookups, whitespace, and a safe path for migrating ERB files to EPP.

Roles and Profiles

  1. 23 The Roles and Profiles Pattern Learn the roles and profiles design pattern: component modules, profiles as technology stacks, roles as business machines, and why each node gets exactly one role.
  2. 24 Profiles with Hiera and Parameters Drive profiles from Hiera data: automatic parameter lookup, hierarchy levels per environment and node, lookup() for glue values, merge behavior and the puppet lookup command.
  3. 25 Node Classification: site.pp and ENCs Decide which classes each node gets: node definitions in site.pp, regex matching, the default node, external node classifiers, Hiera-driven classes and trusted facts.
  4. 26 Roles and Profiles Anti-patterns Spot and fix common mistakes in roles and profiles code: fat roles, node-name logic, hard-coded data, profile chains, class dependency tangles and over-parameterized wrappers.

Testing and Code Management

  1. 27 Puppet Lint and Parser Validate Catch Puppet mistakes before they reach a node: puppet parser validate, puppet-lint checks and plugins, epp validate, YAML checks, noop runs and a pre-commit pipeline.
  2. 28 RSpec-puppet Unit Tests Write unit tests for Puppet code with rspec-puppet: compile catalogs per OS with facts, assert resources and relationships, test defines and functions, and fixtures.
  3. 29 PDK and Module Development Build modules with the Puppet Development Kit: pdk new module, new class and define, pdk validate, pdk test unit, metadata.json, versioning, Puppet Strings and publishing.
  4. 30 Acceptance Testing with Litmus Test Puppet code on real systems with Litmus: provision containers or VMs, install the agent, apply manifests, check idempotence and verify the result with serverspec-style checks.
  5. 31 R10k and the Control Repo Manage Puppet code with Git: the control repository layout, Puppetfile modules, r10k deploy environment, branch-to-environment mapping, a promotion workflow and webhooks.

Scale and Operations

  1. 32 Compile Servers and Scaling Puppet Plan Puppet capacity: how agent runs load the server, JRuby instances and heap size, run interval and splay, compile servers with a load balancer, CA placement and caching.
  2. 33 PuppetDB and Reporting Use PuppetDB to store facts, catalogs and reports: PQL queries, the query() function, exported resources, report processors, node status and dashboards for your fleet.
  3. 34 Orchestration with Bolt: Tasks and Plans Run ad hoc commands and multi-step workflows over SSH and WinRM with Bolt: inventory files, tasks with metadata, YAML and Puppet-language plans, apply blocks and error handling.
  4. 35 Troubleshooting and Debugging Puppet Find and fix Puppet problems fast: reading agent output, --debug and --trace, certificate and SSL errors, compile errors, dependency cycles, duplicate declarations and slow runs.

Projects and Practice

  1. 36 Project: A Complete Web Server Stack Build a full Puppet design for a web server stack: control repo layout, base and web profiles, Hiera data per environment, an EPP vhost template, tests and a rollout plan.
  2. 37 Project: A Security Baseline Design a Puppet security baseline: SSH hardening, password policy, firewall and sudo rules, encrypted secrets with eyaml, compliance data from reports and a drift check.
  3. 38 Practice Exercises and Cheat Sheet Test what you learned with graded Puppet exercises on facts, templates, Hiera, roles and profiles, testing and operations, plus a command and language cheat sheet and review questions.