pry

Simple debugging function for puppet manifests
Hunner

Hunner

hunner

33,614 downloads

33,614 latest version

4.1 quality score

Version information

  • 1.0.0 (latest)
released Jul 3rd 2019

Start using this module

Documentation

hunner/pry — version 1.0.0 Jul 3rd 2019

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.