Puppet Interview Questions and Answers: Advanced, Scenarios and Troubleshooting

Puppet Training Course 28 min min read Updated: Nov 17, 2026 Advanced
Puppet Interview Questions and Answers: Advanced, Scenarios and Troubleshooting
Advanced Topic 2 of 3

Section 1: Architecture and Security

1. How does certificate trust work between agent and server?

The server has a CA. The agent creates a key and a CSR. An admin or an autosign policy signs it. After that both sides use TLS client certificates on port 8140 and verify each other against the CA. Certificates identify nodes and also allow trusted facts.

2. Why is autosign = true dangerous? What do you use instead?

Anyone who can reach the server can get a certificate for any name and then request catalogs (which may contain data). Use a policy executable that checks a challenge password or cloud identity from csr_attributes.yaml, and restrict network access to port 8140.

3. What is the difference between facts and trusted facts?

Normal facts are reported by the node, so they can be wrong or forged. Trusted facts ($trusted) come from the certificate and are verified by the server. Use them for security decisions such as which role or secrets a node gets.

4. How do you protect secrets in Puppet?

  • hiera-eyaml to encrypt values in Git (decrypted on the server)
  • Sensitive type to hide values in logs, reports and diffs
  • Deferred functions or Vault to fetch secrets on the agent so they do not sit in the catalog
  • Strict file modes, limited access to the server and keys, secret scanning in CI
  • Remember that everything in a node's catalog is readable by that node

5. How would you stop one node from reading another node's data?

auth.conf allows a node to fetch only its own catalog (allow: "$1"). Design Hiera and roles so secrets for the database role are only in data used by that role, selected with trusted facts.

6. What are exported resources?

@@type { ... } exports a resource to PuppetDB, and Type <<| |>> collects it on another node. Used for monitoring and load balancer members. Data appears after the exporting node has run and PuppetDB has stored it. Needs PuppetDB.

Section 2: Design and Code Quality

7. How would you design Hiera for 500 servers in 3 environments?

Keep the hierarchy short: node, role, datacenter or cloud region, OS family, common. One control repo, one branch per environment. Put values in common.yaml and override only what differs. Use lookup_options for merging. Encrypt secrets in a separate eyaml level. Use trusted facts and certificate extensions in paths. Document it and test with puppet lookup --explain.

8. What are anti-patterns you have seen?

  • Huge site.pp with copy-paste node blocks
  • Logic like if $hostname == 'web01' in profiles instead of data in Hiera
  • exec without guards, causing changes every run
  • Using class { } everywhere, causing duplicate declarations
  • ensure => latest on production packages
  • Editing downloaded Forge modules in place
  • Secrets in plain text in Git

9. How do you make code idempotent and detect when it is not?

Use real resource types, guard exec with creates, unless, onlyif, refreshonly, avoid dynamic content in files, quote modes. Detect with a second run in tests (idempotent_apply in Litmus) and by checking PuppetDB reports for resources that change every run.

10. How do you handle OS differences cleanly?

Keep values in module data per OS (data/os/RedHat.yaml) and use $facts['os']['family'] only for logic. Avoid long case statements in code. Test with on_supported_os in rspec-puppet.

11. How do you test Puppet code?

  1. puppet parser validate, puppet-lint, yamllint
  2. rspec-puppet unit tests with compile.with_all_deps and on_supported_os
  3. Litmus acceptance tests with idempotence checks
  4. Onceover or catalog diff for the control repo
  5. Noop canaries and staging in the pipeline

12. How do you deploy code to production safely?

Pull request with review, CI (lint, unit, compile), deploy as a branch environment, --noop on test nodes, merge to staging, staging nodes follow, merge to production with r10k or Code Manager, canary nodes first, check PuppetDB reports, then all nodes. Rollback by reverting the commit.

Section 3: Scale and Performance

13. A Puppet server is slow with 3,000 agents. What do you check?

  1. Run interval and splay: are agents hitting the server at the same time?
  2. JRuby pool: free instances, queue length, max-active-instances
  3. JVM heap vs instances (GC pauses, OutOfMemory)
  4. Average compile time per catalog: heavy Hiera, big facts, slow functions, recursive file sources
  5. PuppetDB command queue and PostgreSQL performance
  6. Add compilers behind a load balancer if capacity is too low

14. How many agents can a JRuby instance serve?

About run interval / average compile time. For a 30 minute interval and 6 second compiles, about 300 agents, with headroom less. Measure your own compile time.

15. How do compilers work with the CA?

The primary server holds the CA and signs certificates. Compilers have certificates with the load balancer name in dns_alt_names. Agents point server to the load balancer and ca_server to the primary. Code must be deployed to all compilers.

16. Why prefer puppet:/// file sources less for big data?

The server must serve those files to all agents, using memory and bandwidth, and checksumming large trees is slow. Use packages, an artifact repository, archive with checksums, or object storage.

Section 4: Operations and Troubleshooting Scenarios

17. Scenario: Agents all failed after a deploy. What do you do?

  1. Stop the spread: disable agent runs or revert the deploy (git revert, redeploy production)
  2. Look at the first error in a report or puppet agent -t. Compile error (server) or apply error (agent)?
  3. Reproduce on one node with --noop --debug
  4. Fix forward or roll back. Verify with canary
  5. Add a test or pipeline check so it cannot happen again, write a short post-incident note

18. Scenario: Someone changed sshd_config by hand on a server. What happens?

On the next run Puppet notices a difference from the managed file and reverts it (a corrective change) and restarts sshd if it is notified. The report records the corrective change, which is a signal for review. If the manual change was needed, put it in Hiera and Git.

19. Scenario: Nginx must restart only when the config changes.

file { '/etc/nginx/nginx.conf': ..., notify => Service['nginx'] }. Puppet sends a refresh only if the file actually changed. For safer behaviour use validate_cmd => 'nginx -t -c %' and a restart or reload command for the service.

20. Scenario: A new server stays 'waiting for a signed certificate'.

  • Run puppetserver ca list and compare fingerprints
  • If using autosign, check the policy script and csr_attributes.yaml (set before the first run)
  • Check clock and DNS name matches
  • If a certificate for that name already exists, puppetserver ca clean --certname NAME and recreate

21. Scenario: A resource changes on every run.

Not idempotent. Compare two runs with --show_diff. Check exec guards, changing file content (timestamps), unquoted file modes, packages with latest, or two classes fighting over the same resource.

22. Scenario: You must apply a risky change to 200 production servers.

Use a branch, review, noop first and read the report, then a canary group (5%), watch reports for an hour, then 25%, 50%, 100%. Use Bolt to trigger runs in waves if needed. Have a rollback commit ready. Communicate the window.

23. Scenario: Patch 100 servers behind a load balancer without downtime.

Use a Bolt plan: process in small batches, disable the Puppet agent, drain from the load balancer, update packages, reboot, wait for availability, run health checks, re-enable the agent, add back to the load balancer. Stop the plan automatically if a batch fails.

Section 5: Versions and Ecosystem

24. What changed in Puppet 8?

Ruby 3.2, OpenSSL 3 with stricter certificate algorithms, newer Java for the server, removal of legacy behaviour and settings, strict_variables on by default, legacy facts hidden by default. Test modules and custom Ruby code, upgrade the server before agents.

25. What is OpenVox?

A community fork of open source Puppet maintained by Vox Pupuli, created after open-source Puppet 7 reached end of life and Puppet's distribution moved to a commercial model by Perforce. It aims to stay compatible with Puppet code and modules. Check current documentation for versions and migration steps.

26. When would you choose Bolt over the Puppet agent?

For on-demand actions: patching, restarts, one-time scripts, orchestration across servers, or when you cannot install an agent. Use the agent for continuous desired state. Many teams use both.

27. When would you not use Puppet?

For short-lived containers (use images and Kubernetes), simple one-off tasks (use a script or Bolt), or when the team needs only application deployment with no OS management. Puppet shines for long-lived servers, compliance and large fleets.

Questions to Ask the Interviewer

  • How many nodes and which operating systems do you manage with Puppet?
  • Is it Puppet Enterprise, Puppet Core or OpenVox? What are the upgrade plans?
  • How do changes reach production? Is there a pipeline with tests and canaries?
  • How are secrets handled?
  • How do you measure compliance and run failures?

Conclusion

For advanced interviews, think in trade-offs: security (trusted facts, autosign, secrets), design (roles and profiles, short Hiera), scale (compilers, splay, JRuby) and safe delivery (tests, noop, canaries). Support each answer with a real example.

Quick Summary: trusted facts; autosign policy; eyaml/Sensitive/Deferred; Hiera design; JRuby sizing; canary rollout; corrective change; Bolt vs agent.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators