public
Description: A Ruby DSL for Puppet
Homepage: http://railsmachine.github.com/shadow_puppet
Clone URL: git://github.com/railsmachine/shadow_puppet.git
shadow_puppet / examples / foo.rb
100644 15 lines (13 sloc) 0.531 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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