The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:


ShadowPuppet is a Ruby DSL for Puppet, extracted out of work done by the Rails Machine team on Moonshine

ShadowPuppet provides a DSL for creating collections (manifests) of Puppet Resources in Ruby.

A binary is provided to parse and execute a ShadowPuppet::Manifest.

Example Manifests

A Manifest is an executable collection of Puppet Resources (see the Type Reference ):

class ManifestExample < ShadowShadow::Manifest
  recipe :sample
  recipe :lamp, :ruby               # queue calls to self.lamp and self.ruby when executing
  recipe :mysql, {                  # queue a call to self.mysql passing the provided hash as an option
    :root_password => 'OMGSEKRET'

  def sample
    exec :foo, :command => '/bin/echo "foo" > /tmp/foo.txt'
    package :foo, :ensure => :installed
    file '/tmp/example.txt', :ensure => :present, :contents => Facter.to_hash_inspect

  def lamp
    #install a basic LAMP stack

  def ruby
    #install a ruby interpreter and tools

  def mysql(options)
     #install a mysql server and set the root password to options[:root_password]


To execute the above manifest, instantiate it and call execute on it:

m =

As shown in the +sample+ method in ManifestExample above, instance methods are created for each Puppet::Type available on your system. These methods behave identically to the Puppet Resources methods documented in the Type Reference

To view a list of all defined methods on your system, run:

ruby -rubygems -e 'require "shadow_puppet";puts ShadowPuppet::Manifest.puppet_type_methods'

The use of methods (+sample+, +lamp+, +ruby+, and +mysql+ above) as a container for resources facilitates recipe re-use through the use of Ruby Modules. For example:

module ApachePuppet
  # Required options:
  #   domain
  #   path
  def php_vhost(options)

class MyWebMainfest < ShadowPuppet::Manifest
  include ApachePuppet
  recipe :php_vhost, {
    :domain => '',
    :path => '/var/www/apps/foo'