shadow_puppet

bin/shadow_puppet (view online)
Last Update: Thu Mar 12 16:24:48 -0400 2009

Sample manifest:

 $ cat examples/foo.rb
 class Foo < ShadowPuppet::Manifest
  recipe :demo, :text => 'foo'
  recipe :some_gems

  def some_gems
    package 'rails', :ensure => :updated, :provider => :gem
    package 'railsmachine', :ensure => '1.0.5', :provider => :gem, :require => package('capistrano')
    package 'capistrano', :ensure => :updated, :provider => :gem
  end

  def demo(options = {})
    exec 'sample', :command => "echo '#{options[:text]}' > /tmp/sample.txt"
    file '/tmp/sample2.txt', :ensure => :present, :content => Facter.to_hash.inspect
  end
end

Executing this manifest:

$ shadow_puppet examples/foo.rb
notice: /shadow_puppet:19861340/Exec[foo]/returns: executed successfully
$

The shadow_puppet binary parses the given ruby code, which is expected to contain a class named Foo that inherits from ShadowPuppet::Manifest. An instance of this class is created, and the execute method is called. All output is printed to the console.

Required files

  1. optparse
  2. rubygems
  3. shadow_puppet
  4. active_support/inflector
  5. active_support/core_ext/string/inflections
  6. fileutils