Forge Home

pry

Simple debugging function for puppet manifests

35,212 downloads

35,212 latest version

4.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.0.0 (latest)
released Jun 19th 2013

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'hunner-pry', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add hunner-pry
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install hunner-pry --version 1.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

hunner/pry — version 1.0.0 Jun 19th 2013

Puppet pry() debugging function

When compiling puppet manifests it is often frustrating to find subtle variable parsing or ordering problems. Introspecting specific resource parameters at a given point is also difficult. This function makes those two tasks easier by using pry.

Simply gem install pry and call pry() at some point during a catalog compile by adding it to the specific line in a manifest where you would like to inspect the compilation state, and run the process doing the compilation in the foreground. Puppet will drop into a debugging shell in the Puppet::Parser::Scope object at the time of the function call. A few helpful tips will be printed when the shell is first entered.

When used in manifests during rspec-puppet compilation, the pry REPL will appear in the shell running the spec tests. When used with a puppet master, the master process must be run in the forground with puppet master --no-daemonize --verbose to view the debug shell. If a daemonized master process enters the debug shell, kill must be used to exit the debug shell.

Please see the documentation on Puppet::Parser::Scope and Puppet::Resource::Catalog for relevant method calls.