chef 0.8.10 → 0.8.14

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of chef might be problematic. Click here for more details.

Files changed (105) hide show
  1. data/bin/chef-client +2 -2
  2. data/bin/chef-solo +1 -2
  3. data/bin/knife +1 -2
  4. data/bin/shef +2 -5
  5. data/lib/chef.rb +11 -7
  6. data/lib/chef/application.rb +25 -20
  7. data/lib/chef/application/client.rb +12 -7
  8. data/lib/chef/application/knife.rb +7 -1
  9. data/lib/chef/application/solo.rb +1 -1
  10. data/lib/chef/applications.rb +4 -0
  11. data/lib/chef/cache/checksum.rb +7 -6
  12. data/lib/chef/certificate.rb +2 -2
  13. data/lib/chef/client.rb +28 -4
  14. data/lib/chef/config.rb +4 -3
  15. data/lib/chef/cookbook_loader.rb +6 -1
  16. data/lib/chef/daemon.rb +2 -0
  17. data/lib/chef/data_bag_item.rb +2 -1
  18. data/lib/chef/exceptions.rb +5 -0
  19. data/lib/chef/file_cache.rb +18 -18
  20. data/lib/chef/index_queue/indexable.rb +5 -3
  21. data/lib/chef/knife.rb +45 -13
  22. data/lib/chef/knife/client_list.rb +1 -1
  23. data/lib/chef/knife/client_show.rb +1 -1
  24. data/lib/chef/knife/configure.rb +47 -36
  25. data/lib/chef/knife/cookbook_list.rb +1 -1
  26. data/lib/chef/knife/cookbook_metadata.rb +22 -27
  27. data/lib/chef/knife/cookbook_metadata_from_file.rb +40 -0
  28. data/lib/chef/knife/cookbook_show.rb +2 -2
  29. data/lib/chef/knife/cookbook_site_download.rb +57 -0
  30. data/lib/chef/knife/cookbook_site_list.rb +55 -0
  31. data/lib/chef/knife/cookbook_site_search.rb +50 -0
  32. data/lib/chef/knife/cookbook_site_show.rb +56 -0
  33. data/lib/chef/knife/cookbook_site_vendor.rb +114 -0
  34. data/lib/chef/knife/cookbook_test.rb +103 -0
  35. data/lib/chef/knife/cookbook_upload.rb +29 -38
  36. data/lib/chef/knife/data_bag_edit.rb +1 -1
  37. data/lib/chef/knife/data_bag_list.rb +2 -2
  38. data/lib/chef/knife/data_bag_show.rb +1 -1
  39. data/lib/chef/knife/ec2_instance_data.rb +1 -1
  40. data/lib/chef/knife/index_rebuild.rb +2 -2
  41. data/lib/chef/knife/node_from_file.rb +1 -1
  42. data/lib/chef/knife/node_list.rb +2 -2
  43. data/lib/chef/knife/node_run_list_add.rb +1 -1
  44. data/lib/chef/knife/node_run_list_remove.rb +1 -1
  45. data/lib/chef/knife/node_show.rb +1 -1
  46. data/lib/chef/knife/rackspace_server_create.rb +156 -0
  47. data/lib/chef/knife/rackspace_server_delete.rb +57 -0
  48. data/lib/chef/knife/rackspace_server_list.rb +59 -0
  49. data/lib/chef/knife/role_from_file.rb +1 -1
  50. data/lib/chef/knife/role_list.rb +1 -1
  51. data/lib/chef/knife/role_show.rb +1 -1
  52. data/lib/chef/knife/search.rb +1 -1
  53. data/lib/chef/knife/ssh.rb +21 -4
  54. data/lib/chef/knife/terremark_server_create.rb +152 -0
  55. data/lib/chef/knife/terremark_server_delete.rb +87 -0
  56. data/lib/chef/knife/terremark_server_list.rb +77 -0
  57. data/lib/chef/mixin/command.rb +11 -9
  58. data/lib/chef/mixin/params_validate.rb +1 -1
  59. data/lib/chef/mixin/recipe_definition_dsl_core.rb +4 -1
  60. data/lib/chef/mixin/template.rb +6 -5
  61. data/lib/chef/mixin/xml_escape.rb +3 -3
  62. data/lib/chef/mixins.rb +16 -0
  63. data/lib/chef/node.rb +53 -52
  64. data/lib/chef/openid_registration.rb +0 -1
  65. data/lib/chef/platform.rb +171 -137
  66. data/lib/chef/provider.rb +2 -2
  67. data/lib/chef/provider/cron.rb +22 -22
  68. data/lib/chef/provider/deploy/revision.rb +5 -1
  69. data/lib/chef/provider/erl_call.rb +2 -2
  70. data/lib/chef/provider/file.rb +44 -23
  71. data/lib/chef/provider/group/dscl.rb +6 -4
  72. data/lib/chef/provider/mdadm.rb +0 -4
  73. data/lib/chef/provider/mount/mount.rb +20 -8
  74. data/lib/chef/provider/package.rb +1 -1
  75. data/lib/chef/provider/package/freebsd.rb +22 -18
  76. data/lib/chef/provider/package/rubygems.rb +7 -10
  77. data/lib/chef/provider/remote_directory.rb +15 -0
  78. data/lib/chef/provider/remote_file.rb +73 -50
  79. data/lib/chef/provider/script.rb +10 -8
  80. data/lib/chef/provider/service/windows.rb +129 -0
  81. data/lib/chef/provider/subversion.rb +1 -1
  82. data/lib/chef/provider/template.rb +51 -50
  83. data/lib/chef/providers.rb +80 -0
  84. data/lib/chef/recipe.rb +2 -4
  85. data/lib/chef/resource.rb +21 -7
  86. data/lib/chef/resource/cron.rb +14 -5
  87. data/lib/chef/resource/deploy.rb +52 -45
  88. data/lib/chef/resource/execute.rb +1 -1
  89. data/lib/chef/resource/file.rb +16 -8
  90. data/lib/chef/resource/mount.rb +1 -1
  91. data/lib/chef/resource/remote_directory.rb +19 -10
  92. data/lib/chef/resource/scm.rb +23 -16
  93. data/lib/chef/resource/service.rb +10 -1
  94. data/lib/chef/resources.rb +60 -0
  95. data/lib/chef/rest.rb +234 -189
  96. data/lib/chef/rest/auth_credentials.rb +78 -0
  97. data/lib/chef/{application/server.rb → rest/cookie_jar.rb} +18 -6
  98. data/lib/chef/rest/rest_request.rb +151 -0
  99. data/lib/chef/role.rb +38 -46
  100. data/lib/chef/streaming_cookbook_uploader.rb +8 -2
  101. data/lib/chef/tasks/chef_repo.rake +14 -4
  102. data/lib/chef/util/file_edit.rb +0 -1
  103. data/lib/chef/webui_user.rb +0 -1
  104. metadata +46 -9
  105. data/distro/suse/etc/init.d/chef-client +0 -121
@@ -1,9 +1,15 @@
1
+ # inspired by/cargo-culted from http://stanislavvitvitskiy.blogspot.com/2008/12/multipart-post-in-ruby.html
2
+ # On Apr 6, 2010, at 3:00 PM, Stanislav Vitvitskiy wrote:
3
+ #
4
+ # It's free to use / modify / distribute. No need to mention anything. Just copy/paste and use.
5
+ #
6
+ # Regards,
7
+ # Stan
8
+
1
9
  require 'net/http'
2
10
  require 'mixlib/authentication/signedheaderauth'
3
11
  require 'openssl'
4
12
 
5
- # inspired by/cargo-culted from http://stanislavvitvitskiy.blogspot.com/2008/12/multipart-post-in-ruby.html
6
- # TODO: confirm that code is public domain
7
13
  class Chef
8
14
  class StreamingCookbookUploader
9
15
 
@@ -72,8 +72,8 @@ task :install => [ :update, :roles, :upload_cookbooks ] do
72
72
  end
73
73
  end
74
74
 
75
- desc "By default, run rake test"
76
- task :default => [ :test ]
75
+ desc "By default, run rake test_cookbooks"
76
+ task :default => [ :test_cookbooks ]
77
77
 
78
78
  desc "Create a new cookbook (with COOKBOOK=name, optional CB_PREFIX=site-)"
79
79
  task :new_cookbook do
@@ -213,7 +213,7 @@ EOH
213
213
  end
214
214
 
215
215
  rule(%r{\b(?:site-)?cookbooks/[^/]+/metadata\.json\Z} => [ proc { |task_name| task_name.sub(/\.[^.]+$/, '.rb') } ]) do |t|
216
- system("knife cookbook metadata #{t.source}")
216
+ system("knife cookbook metadata from file #{t.source}")
217
217
  end
218
218
 
219
219
  desc "Build cookbook metadata.json from metadata.rb"
@@ -228,7 +228,7 @@ task :roles => FileList[File.join(TOPDIR, 'roles', '**', '*.rb')].pathmap('%X.j
228
228
 
229
229
  desc "Update a specific role"
230
230
  task :role, :role_name do |t, args|
231
- system("knife role from file #{args.cookbook}")
231
+ system("knife role from file #{File.join(TOPDIR, 'roles', args.role_name)}.rb")
232
232
  end
233
233
 
234
234
  desc "Upload all cookbooks"
@@ -243,3 +243,13 @@ task :upload_cookbook, :cookbook do |t, args|
243
243
  system("knife cookbook upload #{args.cookbook}")
244
244
  end
245
245
 
246
+ desc "Test all cookbooks"
247
+ task :test_cookbooks do
248
+ system("knife cookbook test --all")
249
+ end
250
+
251
+ desc "Test a single cookbook"
252
+ task :test_cookbook, :cookbook do |t, args|
253
+ system("knife cookbook test #{args.cookbook}")
254
+ end
255
+
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
 
18
- require 'ftools'
19
18
  require 'fileutils'
20
19
  require 'tempfile'
21
20
 
@@ -22,7 +22,6 @@ require 'chef/mixin/params_validate'
22
22
  require 'chef/couchdb'
23
23
  require 'chef/index_queue'
24
24
  require 'digest/sha1'
25
- require 'rubygems'
26
25
  require 'json'
27
26
 
28
27
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 8
8
- - 10
9
- version: 0.8.10
8
+ - 14
9
+ version: 0.8.14
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Jacob
@@ -14,13 +14,14 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-01 00:00:00 -07:00
17
+ date: 2010-05-07 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: mixlib-config
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
24
25
  requirements:
25
26
  - - ">="
26
27
  - !ruby/object:Gem::Version
@@ -35,6 +36,7 @@ dependencies:
35
36
  name: mixlib-cli
36
37
  prerelease: false
37
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
38
40
  requirements:
39
41
  - - ">="
40
42
  - !ruby/object:Gem::Version
@@ -49,6 +51,7 @@ dependencies:
49
51
  name: mixlib-log
50
52
  prerelease: false
51
53
  requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
52
55
  requirements:
53
56
  - - ">="
54
57
  - !ruby/object:Gem::Version
@@ -63,6 +66,7 @@ dependencies:
63
66
  name: mixlib-authentication
64
67
  prerelease: false
65
68
  requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
66
70
  requirements:
67
71
  - - ">="
68
72
  - !ruby/object:Gem::Version
@@ -77,6 +81,7 @@ dependencies:
77
81
  name: ohai
78
82
  prerelease: false
79
83
  requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
80
85
  requirements:
81
86
  - - ">="
82
87
  - !ruby/object:Gem::Version
@@ -91,6 +96,7 @@ dependencies:
91
96
  name: bunny
92
97
  prerelease: false
93
98
  requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
94
100
  requirements:
95
101
  - - ">="
96
102
  - !ruby/object:Gem::Version
@@ -105,18 +111,22 @@ dependencies:
105
111
  name: json
106
112
  prerelease: false
107
113
  requirement: &id007 !ruby/object:Gem::Requirement
114
+ none: false
108
115
  requirements:
109
- - - ">="
116
+ - - <=
110
117
  - !ruby/object:Gem::Version
111
118
  segments:
112
- - 0
113
- version: "0"
119
+ - 1
120
+ - 4
121
+ - 2
122
+ version: 1.4.2
114
123
  type: :runtime
115
124
  version_requirements: *id007
116
125
  - !ruby/object:Gem::Dependency
117
126
  name: erubis
118
127
  prerelease: false
119
128
  requirement: &id008 !ruby/object:Gem::Requirement
129
+ none: false
120
130
  requirements:
121
131
  - - ">="
122
132
  - !ruby/object:Gem::Version
@@ -129,6 +139,7 @@ dependencies:
129
139
  name: extlib
130
140
  prerelease: false
131
141
  requirement: &id009 !ruby/object:Gem::Requirement
142
+ none: false
132
143
  requirements:
133
144
  - - ">="
134
145
  - !ruby/object:Gem::Version
@@ -141,6 +152,7 @@ dependencies:
141
152
  name: moneta
142
153
  prerelease: false
143
154
  requirement: &id010 !ruby/object:Gem::Requirement
155
+ none: false
144
156
  requirements:
145
157
  - - ">="
146
158
  - !ruby/object:Gem::Version
@@ -182,14 +194,13 @@ files:
182
194
  - distro/redhat/etc/sysconfig/chef-server-webui
183
195
  - distro/redhat/etc/sysconfig/chef-solr
184
196
  - distro/redhat/etc/sysconfig/chef-solr-indexer
185
- - distro/suse/etc/init.d/chef-client
186
197
  - lib/chef/api_client.rb
187
198
  - lib/chef/application/agent.rb
188
199
  - lib/chef/application/client.rb
189
200
  - lib/chef/application/knife.rb
190
- - lib/chef/application/server.rb
191
201
  - lib/chef/application/solo.rb
192
202
  - lib/chef/application.rb
203
+ - lib/chef/applications.rb
193
204
  - lib/chef/cache/checksum.rb
194
205
  - lib/chef/cache.rb
195
206
  - lib/chef/certificate.rb
@@ -223,7 +234,14 @@ files:
223
234
  - lib/chef/knife/cookbook_download.rb
224
235
  - lib/chef/knife/cookbook_list.rb
225
236
  - lib/chef/knife/cookbook_metadata.rb
237
+ - lib/chef/knife/cookbook_metadata_from_file.rb
226
238
  - lib/chef/knife/cookbook_show.rb
239
+ - lib/chef/knife/cookbook_site_download.rb
240
+ - lib/chef/knife/cookbook_site_list.rb
241
+ - lib/chef/knife/cookbook_site_search.rb
242
+ - lib/chef/knife/cookbook_site_show.rb
243
+ - lib/chef/knife/cookbook_site_vendor.rb
244
+ - lib/chef/knife/cookbook_test.rb
227
245
  - lib/chef/knife/cookbook_upload.rb
228
246
  - lib/chef/knife/data_bag_create.rb
229
247
  - lib/chef/knife/data_bag_delete.rb
@@ -241,6 +259,9 @@ files:
241
259
  - lib/chef/knife/node_run_list_add.rb
242
260
  - lib/chef/knife/node_run_list_remove.rb
243
261
  - lib/chef/knife/node_show.rb
262
+ - lib/chef/knife/rackspace_server_create.rb
263
+ - lib/chef/knife/rackspace_server_delete.rb
264
+ - lib/chef/knife/rackspace_server_list.rb
244
265
  - lib/chef/knife/role_bulk_delete.rb
245
266
  - lib/chef/knife/role_create.rb
246
267
  - lib/chef/knife/role_delete.rb
@@ -250,6 +271,9 @@ files:
250
271
  - lib/chef/knife/role_show.rb
251
272
  - lib/chef/knife/search.rb
252
273
  - lib/chef/knife/ssh.rb
274
+ - lib/chef/knife/terremark_server_create.rb
275
+ - lib/chef/knife/terremark_server_delete.rb
276
+ - lib/chef/knife/terremark_server_list.rb
253
277
  - lib/chef/knife.rb
254
278
  - lib/chef/log.rb
255
279
  - lib/chef/mixin/check_helper.rb
@@ -268,6 +292,7 @@ files:
268
292
  - lib/chef/mixin/recipe_definition_dsl_core.rb
269
293
  - lib/chef/mixin/template.rb
270
294
  - lib/chef/mixin/xml_escape.rb
295
+ - lib/chef/mixins.rb
271
296
  - lib/chef/node/attribute.rb
272
297
  - lib/chef/node.rb
273
298
  - lib/chef/openid_registration.rb
@@ -321,6 +346,7 @@ files:
321
346
  - lib/chef/provider/service/redhat.rb
322
347
  - lib/chef/provider/service/simple.rb
323
348
  - lib/chef/provider/service/upstart.rb
349
+ - lib/chef/provider/service/windows.rb
324
350
  - lib/chef/provider/service.rb
325
351
  - lib/chef/provider/subversion.rb
326
352
  - lib/chef/provider/template.rb
@@ -329,6 +355,7 @@ files:
329
355
  - lib/chef/provider/user/useradd.rb
330
356
  - lib/chef/provider/user.rb
331
357
  - lib/chef/provider.rb
358
+ - lib/chef/providers.rb
332
359
  - lib/chef/recipe.rb
333
360
  - lib/chef/resource/apt_package.rb
334
361
  - lib/chef/resource/bash.rb
@@ -377,6 +404,10 @@ files:
377
404
  - lib/chef/resource_collection.rb
378
405
  - lib/chef/resource_definition.rb
379
406
  - lib/chef/resource_definition_list.rb
407
+ - lib/chef/resources.rb
408
+ - lib/chef/rest/auth_credentials.rb
409
+ - lib/chef/rest/cookie_jar.rb
410
+ - lib/chef/rest/rest_request.rb
380
411
  - lib/chef/rest.rb
381
412
  - lib/chef/role.rb
382
413
  - lib/chef/run_list.rb
@@ -390,6 +421,10 @@ files:
390
421
  - lib/chef/util/file_edit.rb
391
422
  - lib/chef/webui_user.rb
392
423
  - lib/chef.rb
424
+ - bin/chef-client
425
+ - bin/chef-solo
426
+ - bin/knife
427
+ - bin/shef
393
428
  has_rdoc: true
394
429
  homepage: http://wiki.opscode.com/display/chef
395
430
  licenses: []
@@ -400,6 +435,7 @@ rdoc_options: []
400
435
  require_paths:
401
436
  - lib
402
437
  required_ruby_version: !ruby/object:Gem::Requirement
438
+ none: false
403
439
  requirements:
404
440
  - - ">="
405
441
  - !ruby/object:Gem::Version
@@ -407,6 +443,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
407
443
  - 0
408
444
  version: "0"
409
445
  required_rubygems_version: !ruby/object:Gem::Requirement
446
+ none: false
410
447
  requirements:
411
448
  - - ">="
412
449
  - !ruby/object:Gem::Version
@@ -416,7 +453,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
416
453
  requirements: []
417
454
 
418
455
  rubyforge_project:
419
- rubygems_version: 1.3.6
456
+ rubygems_version: 1.3.6.1
420
457
  signing_key:
421
458
  specification_version: 3
422
459
  summary: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.
@@ -1,121 +0,0 @@
1
- #! /bin/sh
2
- # Copyright (c) 1995-2003 SuSE Linux AG, Nuernberg, Germany.
3
- # All rights reserved.
4
- #
5
- # Author: Mario Giammarco
6
- #
7
- ### BEGIN INIT INFO
8
- # Provides: chef-client
9
- # Required-Start: $remote_fs $syslog $named
10
- # Required-Stop: $remote_fs $syslog
11
- # Default-Start: 3 5
12
- # Default-Stop: 0 1 2 6
13
- # Short-Description: Chef client
14
- # Description: Starts chef client
15
- ### END INIT INFO
16
-
17
- # First reset status of this service
18
- . /etc/rc.status
19
- rc_reset
20
-
21
- # Return values acc. to LSB for all commands but status:
22
- # 0 - success
23
- # 1 - generic or unspecified error
24
- # 2 - invalid or excess argument(s)
25
- # 3 - unimplemented feature (e.g. "reload")
26
- # 4 - insufficient privilege
27
- # 5 - program is not installed
28
- # 6 - program is not configured
29
- # 7 - program is not running
30
-
31
- # set default options
32
- CHEF_CONF="/etc/chef/client.rb"
33
- if [ ! -f ${CHEF_CONF} ]; then
34
- echo -n "Chef client configuration file, ${CHEF_CONF} does not exist."
35
- # Tell the user this has skipped
36
- rc_status -s
37
- exit 6
38
- fi
39
-
40
- CHEF_BIN="/usr/bin/chef-client"
41
- if [ ! -x ${CHEF_BIN} ]; then
42
- echo -n "Chef client, ${CHEF_BIN} not installed!"
43
- rc_status -s
44
- exit 5
45
- fi
46
-
47
- CHEF_LOGFILE=/var/log/chef/chef-client.log
48
- CHEF_OPTIONS=""
49
-
50
- # set default PID variables
51
- CHEF_PID="/var/run/chef/chef-client.pid"
52
- CHEF_PID_NOPREFIX="/var/run/chef/chef-client.pid"
53
-
54
- function chef_is_running() {
55
- $0 status >/dev/null
56
- }
57
-
58
- case "$1" in
59
- start)
60
-
61
- echo -n "Starting chef-client"
62
-
63
- startproc $CHEF_BIN -d -c "$CHEF_CONF" -L "$CHEF_LOGFILE" "$CHEF_OPTIONS" ">/dev/null"
64
-
65
- rc_status -v
66
- ;;
67
- stop)
68
- echo -n "Shutting down chef client"
69
- killproc -p ${CHEF_PID} -TERM $CHEF_BIN
70
- rc_status -v
71
- rm -f ${CHEF_PID} 2>/dev/null
72
- ;;
73
- try-restart)
74
- $0 status
75
- if test $? = 0; then
76
- $0 restart $2
77
- else
78
- rc_reset # Not running is not a failure.
79
- fi
80
- # Remember status and be quiet
81
- rc_status
82
- ;;
83
- restart)
84
- $0 stop
85
- $0 start $2
86
- rc_status
87
- ;;
88
- try-restart-iburst)
89
- $0 status
90
- if test $? = 0; then
91
- $0 stop
92
- $0 start iburst
93
- else
94
- rc_reset # Not running is not a failure.
95
- fi
96
- # Remember status and be quiet
97
- rc_status
98
- ;;
99
- force-reload)
100
- # Does not support signalling to reload
101
- $0 try-restart
102
- rc_status
103
- ;;
104
- reload)
105
- echo -n "Reload chef-client"
106
- # Does not support signalling to reload
107
- rc_failed 3
108
- rc_status -v
109
- ;;
110
- status)
111
- checkproc -p ${CHEF_PID} $CHEF_BIN
112
- echo -n "Checking for chef-client "
113
- checkproc -p ${CHEF_PID} $CHEF_BIN
114
- rc_status -v
115
- ;;
116
- *)
117
- echo "Usage: $0 {start|stop|status|try-restart|restart|try-restart-iburst|force-reload|reload|addserver|ntptimeset}"
118
- exit 1
119
- ;;
120
- esac
121
- rc_exit