Fork me on GitHub

Interpreting Relationship Graphs

This tool will compile a catalog, using only the information you provide. This means that all facts will be empty, and custom resources types, such as the mysql_grant type (installed via the puppetlabs/mysql module) will cause an unknown resource type failure.

If you need to test code that depends on fact values you should define a variable with the same name at the top of your code.

# fake fact(s)
$osfamily = 'RedHat'

case $osfamily {
  'RedHat': { notify { 'This is a RedHat family node':      } }
  default : { notify { "I don't know what ${osfamily} is.": } }
}

If you are testing a class, you will need to include it or it won't appear in the catalog.

class silly {
  file { '/tmp/foo':
      ensure => file,
      before => Notify['hi'],
  }
  notify { 'hi': }
}

#include the class in the rendered catalog.
include silly

Any class or type you use or set a relationship on must be defined, or Puppet won't be able to autoload it.

include apache

class apache {
  # a stub class so the catalog will compile.
}