shadow_puppet 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/bin/shadow_puppet CHANGED
@@ -13,7 +13,7 @@
13
13
  # end
14
14
  #
15
15
  # def demo(options = {})
16
- # exec 'sample', :command => "/bin/echo '#{options[:text]}' > /tmp/sample.txt"
16
+ # exec 'sample', :command => "echo '#{options[:text]}' > /tmp/sample.txt"
17
17
  # file '/tmp/sample2.txt', :ensure => :present, :content => Facter.to_hash.inspect
18
18
  # end
19
19
  # end
@@ -52,7 +52,7 @@ begin
52
52
  recipe :foo
53
53
 
54
54
  def foo
55
- exec :foo, :command => '/bin/echo "foo" > /tmp/foo.txt'
55
+ exec :foo, :command => 'echo "foo" > /tmp/foo.txt'
56
56
  file '/tmp/example.txt', :ensure => :present, :content => Facter.to_hash.inspect
57
57
  end
58
58
  end
data/examples/foo.rb CHANGED
@@ -9,7 +9,7 @@ class Foo < ShadowPuppet::Manifest
9
9
  end
10
10
 
11
11
  def demo(options = {})
12
- exec 'sample', :command => "/bin/echo '#{options[:text]}' > /tmp/sample.txt"
12
+ exec 'sample', :command => "echo '#{options[:text]}' > /tmp/sample.txt"
13
13
  file '/tmp/sample2.txt', :ensure => :present, :content => Facter.to_hash.inspect
14
14
  end
15
15
  end
@@ -23,7 +23,7 @@ module ShadowPuppet
23
23
  # } # as an option
24
24
  #
25
25
  # def sample
26
- # exec :foo, :command => '/bin/echo "foo" > /tmp/foo.txt'
26
+ # exec :foo, :command => 'echo "foo" > /tmp/foo.txt'
27
27
  #
28
28
  # package :foo, :ensure => :installed
29
29
  #
@@ -85,7 +85,7 @@ module ShadowPuppet
85
85
 
86
86
  class_inheritable_accessor :recipes
87
87
  self.recipes = []
88
- attr_reader :puppet_resources
88
+ attr_reader :puppet_resources, :name
89
89
 
90
90
  # Initialize a new instance of this manifest. This can take a hash of
91
91
  # options that are avaliable later via the options method.
@@ -99,6 +99,7 @@ module ShadowPuppet
99
99
  Puppet::Util::Log.newdestination(:console)
100
100
  Puppet::Util::Log.level = :info
101
101
 
102
+ @name = self.class
102
103
  @options = HashWithIndifferentAccess.new(options)
103
104
  @executed = false
104
105
  @puppet_resources = Hash.new do |hash, key|
@@ -258,6 +259,16 @@ module ShadowPuppet
258
259
  @puppet_resources[type][name] = obj
259
260
  end
260
261
 
262
+ case type.name
263
+ when :exec
264
+ param = Puppet::Parser::Resource::Param.new(
265
+ :name => :path,
266
+ :value => ENV["PATH"],
267
+ :source => self
268
+ )
269
+ obj.send(:set_parameter, param)
270
+ end
271
+
261
272
  params.each do |param_name, param_value|
262
273
  param = Puppet::Parser::Resource::Param.new(
263
274
  :name => param_name,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shadow_puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Newland
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-03 00:00:00 -05:00
12
+ date: 2009-02-05 00:00:00 -05:00
13
13
  default_executable: shadow_puppet
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency