chef 10.14.4 → 10.16.0.rc.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. data/distro/common/html/chef-client.8.html +4 -4
  2. data/distro/common/html/chef-expander.8.html +4 -4
  3. data/distro/common/html/chef-expanderctl.8.html +4 -4
  4. data/distro/common/html/chef-server-webui.8.html +4 -4
  5. data/distro/common/html/chef-server.8.html +182 -0
  6. data/distro/common/html/chef-solo.8.html +4 -4
  7. data/distro/common/html/chef-solr.8.html +4 -4
  8. data/distro/common/html/knife-bootstrap.1.html +5 -5
  9. data/distro/common/html/knife-client.1.html +4 -4
  10. data/distro/common/html/knife-configure.1.html +5 -5
  11. data/distro/common/html/knife-cookbook-site.1.html +4 -4
  12. data/distro/common/html/knife-cookbook.1.html +8 -8
  13. data/distro/common/html/knife-data-bag.1.html +4 -4
  14. data/distro/common/html/knife-environment.1.html +7 -7
  15. data/distro/common/html/knife-exec.1.html +4 -4
  16. data/distro/common/html/knife-index.1.html +4 -4
  17. data/distro/common/html/knife-node.1.html +5 -5
  18. data/distro/common/html/knife-role.1.html +4 -4
  19. data/distro/common/html/knife-search.1.html +6 -6
  20. data/distro/common/html/knife-ssh.1.html +4 -4
  21. data/distro/common/html/knife-status.1.html +5 -5
  22. data/distro/common/html/knife-tag.1.html +4 -4
  23. data/distro/common/html/knife.1.html +4 -4
  24. data/distro/common/html/shef.1.html +4 -4
  25. data/distro/common/man/man1/knife-bootstrap.1 +1 -1
  26. data/distro/common/man/man1/knife-client.1 +1 -1
  27. data/distro/common/man/man1/knife-configure.1 +1 -1
  28. data/distro/common/man/man1/knife-cookbook-site.1 +1 -1
  29. data/distro/common/man/man1/knife-cookbook.1 +1 -1
  30. data/distro/common/man/man1/knife-data-bag.1 +1 -1
  31. data/distro/common/man/man1/knife-environment.1 +1 -1
  32. data/distro/common/man/man1/knife-exec.1 +1 -1
  33. data/distro/common/man/man1/knife-index.1 +1 -1
  34. data/distro/common/man/man1/knife-node.1 +1 -1
  35. data/distro/common/man/man1/knife-role.1 +1 -1
  36. data/distro/common/man/man1/knife-search.1 +1 -1
  37. data/distro/common/man/man1/knife-ssh.1 +1 -1
  38. data/distro/common/man/man1/knife-status.1 +1 -1
  39. data/distro/common/man/man1/knife-tag.1 +1 -1
  40. data/distro/common/man/man1/knife.1 +1 -1
  41. data/distro/common/man/man1/shef.1 +1 -1
  42. data/distro/common/man/man8/chef-client.8 +1 -1
  43. data/distro/common/man/man8/chef-expander.8 +1 -1
  44. data/distro/common/man/man8/chef-expanderctl.8 +1 -1
  45. data/distro/common/man/man8/chef-server-webui.8 +1 -1
  46. data/distro/common/man/man8/chef-server.8 +1 -1
  47. data/distro/common/man/man8/chef-solo.8 +1 -1
  48. data/distro/common/man/man8/chef-solr.8 +1 -1
  49. data/distro/debian/etc/init.d/chef-client +1 -1
  50. data/distro/debian/etc/init.d/chef-expander +1 -1
  51. data/distro/debian/etc/init.d/chef-server +1 -1
  52. data/distro/debian/etc/init.d/chef-server-webui +1 -1
  53. data/distro/debian/etc/init.d/chef-solr +1 -1
  54. data/lib/chef/application/client.rb +3 -3
  55. data/lib/chef/client.rb +4 -1
  56. data/lib/chef/config.rb +2 -1
  57. data/lib/chef/knife/bootstrap/archlinux-gems.erb +2 -0
  58. data/lib/chef/knife/bootstrap/centos5-gems.erb +2 -0
  59. data/lib/chef/knife/bootstrap/chef-full.erb +2 -1
  60. data/lib/chef/knife/bootstrap/fedora13-gems.erb +2 -0
  61. data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +2 -0
  62. data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +2 -0
  63. data/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb +2 -0
  64. data/lib/chef/knife/configure.rb +19 -0
  65. data/lib/chef/knife/data_bag_from_file.rb +1 -1
  66. data/lib/chef/knife/environment_from_file.rb +41 -8
  67. data/lib/chef/knife/ssh.rb +5 -1
  68. data/lib/chef/provider/cookbook_file.rb +4 -4
  69. data/lib/chef/provider/directory.rb +3 -0
  70. data/lib/chef/provider/file.rb +49 -3
  71. data/lib/chef/provider/ifconfig.rb +1 -1
  72. data/lib/chef/provider/package.rb +2 -0
  73. data/lib/chef/provider/package/pacman.rb +10 -1
  74. data/lib/chef/provider/remote_file.rb +1 -1
  75. data/lib/chef/provider/service.rb +22 -0
  76. data/lib/chef/provider/template.rb +9 -1
  77. data/lib/chef/resource.rb +1 -1
  78. data/lib/chef/resource/cookbook_file.rb +1 -0
  79. data/lib/chef/resource/cron.rb +5 -0
  80. data/lib/chef/resource/deploy.rb +6 -1
  81. data/lib/chef/resource/directory.rb +6 -0
  82. data/lib/chef/resource/env.rb +5 -0
  83. data/lib/chef/resource/erl_call.rb +3 -0
  84. data/lib/chef/resource/execute.rb +3 -0
  85. data/lib/chef/resource/file.rb +5 -5
  86. data/lib/chef/resource/group.rb +5 -0
  87. data/lib/chef/resource/http_request.rb +3 -0
  88. data/lib/chef/resource/ifconfig.rb +5 -0
  89. data/lib/chef/resource/link.rb +6 -1
  90. data/lib/chef/resource/log.rb +19 -16
  91. data/lib/chef/resource/mdadm.rb +5 -0
  92. data/lib/chef/resource/mount.rb +5 -0
  93. data/lib/chef/resource/ohai.rb +14 -0
  94. data/lib/chef/resource/package.rb +2 -1
  95. data/lib/chef/resource/remote_directory.rb +5 -0
  96. data/lib/chef/resource/route.rb +6 -1
  97. data/lib/chef/resource/ruby_block.rb +11 -0
  98. data/lib/chef/resource/scm.rb +4 -0
  99. data/lib/chef/resource/script.rb +3 -0
  100. data/lib/chef/resource/service.rb +5 -0
  101. data/lib/chef/resource/subversion.rb +2 -1
  102. data/lib/chef/resource/template.rb +1 -0
  103. data/lib/chef/resource/user.rb +4 -0
  104. data/lib/chef/resource_reporter.rb +71 -27
  105. data/lib/chef/rest.rb +8 -4
  106. data/lib/chef/run_list.rb +2 -2
  107. data/lib/chef/scan_access_control.rb +1 -1
  108. data/lib/chef/version.rb +1 -1
  109. data/spec/unit/client_spec.rb +6 -2
  110. data/spec/unit/knife/configure_spec.rb +121 -25
  111. data/spec/unit/knife/data_bag_from_file_spec.rb +5 -3
  112. data/spec/unit/knife/environment_from_file_spec.rb +23 -0
  113. data/spec/unit/provider/cookbook_file_spec.rb +3 -0
  114. data/spec/unit/provider/directory_spec.rb +16 -17
  115. data/spec/unit/provider/file_spec.rb +75 -0
  116. data/spec/unit/provider/ifconfig_spec.rb +2 -2
  117. data/spec/unit/provider/package/pacman_spec.rb +29 -0
  118. data/spec/unit/provider/package_spec.rb +4 -0
  119. data/spec/unit/provider/remote_directory_spec.rb +6 -1
  120. data/spec/unit/provider/remote_file_spec.rb +7 -0
  121. data/spec/unit/resource/cookbook_file_spec.rb +42 -1
  122. data/spec/unit/resource/cron_spec.rb +27 -0
  123. data/spec/unit/resource/deploy_spec.rb +27 -0
  124. data/spec/unit/resource/directory_spec.rb +20 -0
  125. data/spec/unit/resource/env_spec.rb +19 -0
  126. data/spec/unit/resource/erl_call_spec.rb +12 -0
  127. data/spec/unit/resource/execute_spec.rb +16 -0
  128. data/spec/unit/resource/group_spec.rb +17 -1
  129. data/spec/unit/resource/http_request_spec.rb +13 -0
  130. data/spec/unit/resource/ifconfig_spec.rb +46 -0
  131. data/spec/unit/resource/link_spec.rb +21 -0
  132. data/spec/unit/resource/log_spec.rb +10 -0
  133. data/spec/unit/resource/mdadm_spec.rb +22 -0
  134. data/spec/unit/resource/mount_spec.rb +20 -0
  135. data/spec/unit/resource/ohai_spec.rb +18 -0
  136. data/spec/unit/resource/package_spec.rb +3 -0
  137. data/spec/unit/resource/remote_directory_spec.rb +22 -0
  138. data/spec/unit/resource/remote_file_spec.rb +40 -0
  139. data/spec/unit/resource/route_spec.rb +19 -0
  140. data/spec/unit/resource/ruby_block_spec.rb +11 -0
  141. data/spec/unit/resource/scm_spec.rb +20 -0
  142. data/spec/unit/resource/script_spec.rb +14 -0
  143. data/spec/unit/resource/service_spec.rb +21 -0
  144. data/spec/unit/resource/user_spec.rb +21 -0
  145. data/spec/unit/resource_reporter_spec.rb +260 -134
  146. data/spec/unit/run_list_spec.rb +14 -0
  147. metadata +15 -10
@@ -29,10 +29,7 @@ class Chef
29
29
 
30
30
  def load_current_resource
31
31
  @current_resource = Chef::Resource::CookbookFile.new(@new_resource.name)
32
- @new_resource.path.gsub!(/\\/, "/") # for Windows
33
- @current_resource.path(@new_resource.path)
34
- setup_acl
35
- @current_resource
32
+ super
36
33
  end
37
34
 
38
35
  def action_create
@@ -47,6 +44,9 @@ class Chef
47
44
  Chef::Log.debug("#{@new_resource} staging #{file_cache_location} to #{tempfile.path}")
48
45
  tempfile.close
49
46
  FileUtils.cp(file_cache_location, tempfile.path)
47
+ # Since the @new_resource.path file will not be updated
48
+ # at the time of converge, we must use the tempfile
49
+ update_new_file_state(tempfile.path)
50
50
  end
51
51
  Chef::Log.info("#{@new_resource} created file #{@new_resource.path}")
52
52
  end
@@ -33,9 +33,12 @@ class Chef
33
33
  def load_current_resource
34
34
  @current_resource = Chef::Resource::Directory.new(@new_resource.name)
35
35
  @current_resource.path(@new_resource.path)
36
+ load_current_resource_attrs
36
37
  setup_acl
38
+
37
39
  @current_resource
38
40
  end
41
+
39
42
  def define_resource_requirements
40
43
  # this must be evaluated before whyrun messages are printed
41
44
  access_controls.requires_changes?
@@ -58,12 +58,14 @@ class Chef
58
58
 
59
59
  def is_binary?(path)
60
60
  ::File.open(path) do |file|
61
+
61
62
  buff = file.read(Chef::Config[:diff_filesize_threshold])
62
63
  buff = "" if buff.nil?
63
64
  return buff !~ /^[\r[:print:]]*$/
64
65
  end
65
66
  end
66
67
 
68
+
67
69
  def diff_current(temp_path)
68
70
  suppress_resource_reporting = false
69
71
 
@@ -123,13 +125,39 @@ class Chef
123
125
  end
124
126
 
125
127
  def load_current_resource
126
- @current_resource = Chef::Resource::File.new(@new_resource.name)
128
+ # Every child should be specifying their own constructor, so this
129
+ # should only be run in the file case.
130
+ @current_resource ||= Chef::Resource::File.new(@new_resource.name)
127
131
  @new_resource.path.gsub!(/\\/, "/") # for Windows
128
132
  @current_resource.path(@new_resource.path)
129
- if @new_resource.content && ::File.exist?(@new_resource.path)
130
- @current_resource.checksum(checksum(@new_resource.path))
133
+ if !::File.directory?(@new_resource.path)
134
+ if ::File.exist?(@new_resource.path)
135
+ @current_resource.checksum(checksum(@new_resource.path))
136
+ end
131
137
  end
138
+ load_current_resource_attrs
132
139
  setup_acl
140
+
141
+ @current_resource
142
+ end
143
+
144
+ def load_current_resource_attrs
145
+ if ::File.exist?(@new_resource.path)
146
+ stat = ::File.stat(@new_resource.path)
147
+ @current_resource.owner(stat.uid)
148
+ @current_resource.mode(stat.mode & 07777)
149
+ @current_resource.group(stat.gid)
150
+
151
+ if @new_resource.group.nil?
152
+ @new_resource.group(@current_resource.group)
153
+ end
154
+ if @new_resource.owner.nil?
155
+ @new_resource.owner(@current_resource.owner)
156
+ end
157
+ if @new_resource.mode.nil?
158
+ @new_resource.mode(@current_resource.mode)
159
+ end
160
+ end
133
161
  end
134
162
 
135
163
  def setup_acl
@@ -183,6 +211,19 @@ class Chef
183
211
  end
184
212
  end
185
213
 
214
+ # if you are using a tempfile before creating, you must
215
+ # override the default with the tempfile, since the
216
+ # file at @new_resource.path will not be updated on converge
217
+ def update_new_file_state(path=@new_resource.path)
218
+ stat = ::File.stat(path)
219
+ @new_resource.owner(stat.uid)
220
+ @new_resource.mode(stat.mode & 07777)
221
+ @new_resource.group(stat.gid)
222
+ if !::File.directory?(path)
223
+ @new_resource.checksum(checksum(path))
224
+ end
225
+ end
226
+
186
227
  def action_create
187
228
  if !::File.exists?(@new_resource.path)
188
229
  description = []
@@ -190,10 +231,13 @@ class Chef
190
231
  desc << " with content checksum #{short_cksum(new_resource_content_checksum)}" if new_resource.content
191
232
  description << desc
192
233
  description << diff_current_from_content(@new_resource.content)
234
+
193
235
  converge_by(description) do
236
+ Chef::Log.info("entered create")
194
237
  ::File.open(@new_resource.path, "w+") {|f| f.write @new_resource.content }
195
238
  access_controls.set_all
196
239
  Chef::Log.info("#{@new_resource} created file #{@new_resource.path}")
240
+ update_new_file_state
197
241
  end
198
242
  else
199
243
  set_content unless @new_resource.content.nil?
@@ -205,6 +249,8 @@ class Chef
205
249
  if access_controls.requires_changes?
206
250
  converge_by(access_controls.describe_changes) do
207
251
  access_controls.set_all
252
+ #Update file state with new access values
253
+ update_new_file_state
208
254
  end
209
255
  end
210
256
  end
@@ -199,7 +199,7 @@ class Chef
199
199
  ifcfg_file = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}"
200
200
  if ::File.exist?(ifcfg_file)
201
201
  converge_by ("delete the #{ifcfg_file}") do
202
- FileUtils.rm_f(ifcfg_file, :verbose => false, :force => true)
202
+ FileUtils.rm_f(ifcfg_file, :verbose => false)
203
203
  end
204
204
  end
205
205
  when "debian","ubuntu"
@@ -78,6 +78,7 @@ class Chef
78
78
  end
79
79
  description = install_version ? "version #{install_version} of" : ""
80
80
  converge_by("install #{description} package #{@new_resource.package_name}") do
81
+ @new_resource.version(install_version)
81
82
  install_package(@new_resource.package_name, install_version)
82
83
  end
83
84
  end
@@ -88,6 +89,7 @@ class Chef
88
89
  elsif @current_resource.version == candidate_version
89
90
  Chef::Log.debug("#{@new_resource} is at the latest version - nothing to do")
90
91
  else
92
+ @new_resource.version(candidate_version)
91
93
  orig_version = @current_resource.version || "uninstalled"
92
94
  converge_by("upgrade package #{@new_resource.package_name} from #{orig_version} to #{candidate_version}") do
93
95
  status = upgrade_package(@new_resource.package_name, candidate_version)
@@ -53,10 +53,19 @@ class Chef
53
53
  def candidate_version
54
54
  return @candidate_version if @candidate_version
55
55
 
56
+ repos = ["extra","core","community"]
57
+
58
+ if(::File.exists?("/etc/pacman.conf"))
59
+ pacman = ::File.read("/etc/pacman.conf")
60
+ repos = pacman.scan(/\[(.+)\]/).flatten
61
+ end
62
+
63
+ package_repos = repos.map {|r| Regexp.escape(r) }.join('|')
64
+
56
65
  status = popen4("pacman -Ss #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
57
66
  stdout.each do |line|
58
67
  case line
59
- when /^(extra|core|community)\/#{Regexp.escape(@new_resource.package_name)} (.+)$/
68
+ when /^(#{package_repos})\/#{Regexp.escape(@new_resource.package_name)} (.+)$/
60
69
  # $2 contains a string like "4.4.0-1 (kde kdenetwork)" or "3.10-4 (base)"
61
70
  # simply split by space and use first token
62
71
  @candidate_version = $2.split(" ").first
@@ -27,8 +27,8 @@ class Chef
27
27
  class RemoteFile < Chef::Provider::File
28
28
 
29
29
  def load_current_resource
30
+ @current_resource = Chef::Resource::RemoteFile.new(@new_resource.name)
30
31
  super
31
- @current_resource.checksum(checksum(@current_resource.path)) if ::File.exist?(@current_resource.path)
32
32
  end
33
33
 
34
34
  def action_create
@@ -34,6 +34,17 @@ class Chef
34
34
  true
35
35
  end
36
36
 
37
+ def load_new_resource_state
38
+ # If the user didn't specify a change in enabled state,
39
+ # it will be the same as the old resource
40
+ if ( @new_resource.enabled.nil? )
41
+ @new_resource.enabled(@current_resource.enabled)
42
+ end
43
+ if ( @new_resource.running.nil? )
44
+ @new_resource.running(@current_resource.running)
45
+ end
46
+ end
47
+
37
48
  def shared_resource_requirements
38
49
  end
39
50
 
@@ -56,6 +67,8 @@ class Chef
56
67
  Chef::Log.info("#{@new_resource} enabled")
57
68
  end
58
69
  end
70
+ load_new_resource_state
71
+ @new_resource.enabled(true)
59
72
  end
60
73
 
61
74
  def action_disable
@@ -67,6 +80,8 @@ class Chef
67
80
  else
68
81
  Chef::Log.debug("#{@new_resource} already disabled - nothing to do")
69
82
  end
83
+ load_new_resource_state
84
+ @new_resource.enabled(false)
70
85
  end
71
86
 
72
87
  def action_start
@@ -78,6 +93,8 @@ class Chef
78
93
  else
79
94
  Chef::Log.debug("#{@new_resource} already running - nothing to do")
80
95
  end
96
+ load_new_resource_state
97
+ @new_resource.running(true)
81
98
  end
82
99
 
83
100
  def action_stop
@@ -89,6 +106,8 @@ class Chef
89
106
  else
90
107
  Chef::Log.debug("#{@new_resource} already stopped - nothing to do")
91
108
  end
109
+ load_new_resource_state
110
+ @new_resource.running(false)
92
111
  end
93
112
 
94
113
  def action_restart
@@ -96,6 +115,8 @@ class Chef
96
115
  restart_service
97
116
  Chef::Log.info("#{@new_resource} restarted")
98
117
  end
118
+ load_new_resource_state
119
+ @new_resource.running(true)
99
120
  end
100
121
 
101
122
  def action_reload
@@ -105,6 +126,7 @@ class Chef
105
126
  Chef::Log.info("#{@new_resource} reloaded")
106
127
  end
107
128
  end
129
+ load_new_resource_state
108
130
  end
109
131
 
110
132
  def enable_service
@@ -31,8 +31,8 @@ class Chef
31
31
  include Chef::Mixin::Template
32
32
 
33
33
  def load_current_resource
34
+ @current_resource = Chef::Resource::Template.new(@new_resource.name)
34
35
  super
35
- @current_resource.checksum(checksum(@current_resource.path)) if ::File.exist?(@current_resource.path)
36
36
  end
37
37
 
38
38
  def define_resource_requirements
@@ -64,6 +64,14 @@ class Chef
64
64
  FileUtils.mv(rendered_template.path, @new_resource.path)
65
65
  Chef::Log.info("#{@new_resource} updated content")
66
66
  access_controls.set_all!
67
+ stat = ::File.stat(@new_resource.path)
68
+
69
+ # template depends on the checksum not changing, and updates it
70
+ # itself later in the code, so we cannot set it here, as we do with
71
+ # all other < File child provider classes
72
+ @new_resource.owner(stat.uid)
73
+ @new_resource.mode(stat.mode & 07777)
74
+ @new_resource.group(stat.gid)
67
75
  end
68
76
  end
69
77
  end
@@ -606,8 +606,8 @@ F
606
606
  raise customize_exception(e)
607
607
  end
608
608
  ensure
609
- events.resource_completed(self)
610
609
  @elapsed_time = Time.now - start_time
610
+ events.resource_completed(self)
611
611
  end
612
612
  end
613
613
 
@@ -1,6 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@opscode.com>)
3
3
  # Author:: Seth Chisamore (<schisamo@opscode.com>)
4
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
4
5
  # Copyright:: Copyright (c) 2008, 2011 Opscode, Inc.
5
6
  # License:: Apache License, Version 2.0
6
7
  #
@@ -1,5 +1,6 @@
1
1
  #
2
2
  # Author:: Bryan McLellan (btm@loftninjas.org)
3
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
3
4
  # Copyright:: Copyright (c) 2009 Bryan McLellan
4
5
  # License:: Apache License, Version 2.0
5
6
  #
@@ -22,6 +23,10 @@ class Chef
22
23
  class Resource
23
24
  class Cron < Chef::Resource
24
25
 
26
+ identity_attr :command
27
+
28
+ state_attrs :minute, :hour, :day, :month, :weekday, :user
29
+
25
30
  def initialize(name, run_context=nil)
26
31
  super
27
32
  @resource_name = :cron
@@ -1,5 +1,6 @@
1
1
  #
2
2
  # Author:: Daniel DeLeo (<dan@kallistec.com>)
3
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
3
4
  # Copyright:: Copyright (c) 2008 Opscode, Inc.
4
5
  # License:: Apache License, Version 2.0
5
6
  #
@@ -49,9 +50,13 @@ class Chef
49
50
  # release directory. Callback files can contain chef code (resources, etc.)
50
51
  #
51
52
  class Deploy < Chef::Resource
52
-
53
+
53
54
  provider_base Chef::Provider::Deploy
54
55
 
56
+ identity_attr :repository
57
+
58
+ state_attrs :deploy_to, :revision
59
+
55
60
  def initialize(name, run_context=nil)
56
61
  super
57
62
  @resource_name = :deploy
@@ -1,6 +1,7 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@opscode.com>)
3
3
  # Author:: Seth Chisamore (<schisamo@opscode.com>)
4
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
4
5
  # Copyright:: Copyright (c) 2008, 2011 Opscode, Inc.
5
6
  # License:: Apache License, Version 2.0
6
7
  #
@@ -24,6 +25,11 @@ require 'chef/mixin/securable'
24
25
  class Chef
25
26
  class Resource
26
27
  class Directory < Chef::Resource
28
+
29
+ identity_attr :path
30
+
31
+ state_attrs :group, :mode, :owner
32
+
27
33
  include Chef::Mixin::Securable
28
34
 
29
35
  provides :directory, :on_platforms => :all
@@ -1,5 +1,6 @@
1
1
  #
2
2
  # Author:: Doug MacEachern (<dougm@vmware.com>)
3
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
3
4
  # Copyright:: Copyright (c) 2010 VMware, Inc.
4
5
  # License:: Apache License, Version 2.0
5
6
  #
@@ -20,6 +21,10 @@ class Chef
20
21
  class Resource
21
22
  class Env < Chef::Resource
22
23
 
24
+ identity_attr :key_name
25
+
26
+ state_attrs :value
27
+
23
28
  def initialize(name, run_context=nil)
24
29
  super
25
30
  @resource_name = :env
@@ -1,5 +1,6 @@
1
1
  #
2
2
  # Author:: Joe Williams (<joe@joetify.com>)
3
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
3
4
  # Copyright:: Copyright (c) 2009 Joe Williams
4
5
  # License:: Apache License, Version 2.0
5
6
  #
@@ -24,6 +25,8 @@ class Chef
24
25
 
25
26
  # erl_call : http://erlang.org/doc/man/erl_call.html
26
27
 
28
+ identity_attr :code
29
+
27
30
  def initialize(name, run_context=nil)
28
31
  super
29
32
  @resource_name = :erl_call
@@ -1,5 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@opscode.com>)
3
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
3
4
  # Copyright:: Copyright (c) 2008 Opscode, Inc.
4
5
  # License:: Apache License, Version 2.0
5
6
  #
@@ -22,6 +23,8 @@ class Chef
22
23
  class Resource
23
24
  class Execute < Chef::Resource
24
25
 
26
+ identity_attr :command
27
+
25
28
  def initialize(name, run_context=nil)
26
29
  super
27
30
  @resource_name = :execute
@@ -29,11 +29,11 @@ class Chef
29
29
 
30
30
  identity_attr :path
31
31
 
32
- state_attrs :checksum, :owner, :group, :mode
33
-
34
- # By default, windows gets `state_attrs :rights, :deny_rights`
35
32
  if Platform.windows?
36
- state_attrs :rights, :deny_rights
33
+ # Use Windows rights instead of standard *nix permissions
34
+ state_attrs :checksum, :rights, :deny_rights
35
+ else
36
+ state_attrs :checksum, :owner, :group, :mode
37
37
  end
38
38
 
39
39
  provides :file, :on_platforms => :all
@@ -52,7 +52,7 @@ class Chef
52
52
 
53
53
  def content(arg=nil)
54
54
  set_or_return(
55
- :content,
55
+ :content,
56
56
  arg,
57
57
  :kind_of => String
58
58
  )
@@ -1,5 +1,6 @@
1
1
  #
2
2
  # Author:: Adam Jacob (<adam@opscode.com>)
3
+ # Author:: Tyler Cloke (<tyler@opscode.com>)
3
4
  # Copyright:: Copyright (c) 2008 OpsCode, Inc.
4
5
  # License:: Apache License, Version 2.0
5
6
  #
@@ -20,6 +21,10 @@ class Chef
20
21
  class Resource
21
22
  class Group < Chef::Resource
22
23
 
24
+ identity_attr :group_name
25
+
26
+ state_attrs :members
27
+
23
28
  def initialize(name, run_context=nil)
24
29
  super
25
30
  @resource_name = :group