chef 0.10.0.beta.7 → 0.10.0.beta.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/distro/common/html/knife-bootstrap.1.html +182 -0
  2. data/distro/common/html/knife-client.1.html +216 -0
  3. data/distro/common/html/knife-configure.1.html +170 -0
  4. data/distro/common/html/knife-cookbook-site.1.html +166 -0
  5. data/distro/common/html/knife-cookbook.1.html +233 -0
  6. data/distro/common/html/knife-data-bag.1.html +234 -0
  7. data/distro/common/html/knife-environment.1.html +93 -0
  8. data/distro/common/html/knife-exec.1.html +93 -0
  9. data/distro/common/html/knife-index.1.html +125 -0
  10. data/distro/common/html/knife-node.1.html +268 -0
  11. data/distro/common/html/knife-recipe.1.html +92 -0
  12. data/distro/common/html/knife-role.1.html +136 -0
  13. data/distro/common/html/knife-search.1.html +102 -0
  14. data/distro/common/html/knife-ssh.1.html +101 -0
  15. data/distro/common/html/knife-status.1.html +97 -0
  16. data/distro/common/html/knife-tag.1.html +93 -0
  17. data/distro/common/html/knife.1.html +362 -0
  18. data/distro/common/man/man1/knife-bootstrap.1 +137 -0
  19. data/distro/common/man/man1/knife-client.1 +98 -0
  20. data/distro/common/man/man1/knife-configure.1 +88 -0
  21. data/distro/common/man/man1/knife-cookbook-site.1 +91 -0
  22. data/distro/common/man/man1/knife-cookbook.1 +242 -0
  23. data/distro/common/man/man1/knife-data-bag.1 +130 -0
  24. data/distro/common/man/man1/knife-environment.1 +13 -0
  25. data/distro/common/man/man1/knife-exec.1 +13 -0
  26. data/distro/common/man/man1/knife-index.1 +29 -0
  27. data/distro/common/man/man1/knife-node.1 +153 -0
  28. data/distro/common/man/man1/knife-recipe.1 +13 -0
  29. data/distro/common/man/man1/knife-role.1 +64 -0
  30. data/distro/common/man/man1/knife-search.1 +37 -0
  31. data/distro/common/man/man1/knife-ssh.1 +33 -0
  32. data/distro/common/man/man1/knife-status.1 +17 -0
  33. data/distro/common/man/man1/knife-tag.1 +13 -0
  34. data/distro/common/man/man1/knife.1 +346 -0
  35. data/distro/common/man/{man8/shef.8 → man1/shef.1} +0 -0
  36. data/distro/common/man/{man1/chef-server-webui.1 → man8/chef-server-webui.8} +0 -0
  37. data/distro/common/man/{man1/chef-server.1 → man8/chef-server.8} +0 -0
  38. data/distro/common/man/{man1/chef-solr.1 → man8/chef-solr.8} +0 -0
  39. data/distro/common/markdown/man1/knife-bootstrap.mkd +88 -0
  40. data/distro/common/markdown/man1/knife-client.mkd +101 -0
  41. data/distro/common/markdown/man1/knife-configure.mkd +70 -0
  42. data/distro/common/markdown/man1/knife-cookbook-site.mkd +69 -0
  43. data/distro/common/markdown/man1/knife-cookbook.mkd +136 -0
  44. data/distro/common/markdown/man1/knife-data-bag.mkd +117 -0
  45. data/distro/common/markdown/man1/knife-environment.mkd +8 -0
  46. data/distro/common/markdown/man1/knife-exec.mkd +9 -0
  47. data/distro/common/markdown/man1/knife-index.mkd +30 -0
  48. data/distro/common/markdown/man1/knife-node.mkd +147 -0
  49. data/distro/common/markdown/man1/knife-recipe.mkd +24 -0
  50. data/distro/common/markdown/man1/knife-role.mkd +79 -0
  51. data/distro/common/markdown/man1/knife-search.mkd +56 -0
  52. data/distro/common/markdown/man1/knife-ssh.mkd +64 -0
  53. data/distro/common/markdown/man1/knife-status.mkd +38 -0
  54. data/distro/common/markdown/man1/knife-tag.mkd +8 -0
  55. data/distro/common/markdown/man1/knife.mkd +261 -0
  56. data/lib/chef/cookbook/metadata.rb +76 -40
  57. data/lib/chef/cookbook_version.rb +86 -2
  58. data/lib/chef/cookbook_version_selector.rb +7 -2
  59. data/lib/chef/environment.rb +41 -0
  60. data/lib/chef/knife/configure.rb +4 -0
  61. data/lib/chef/knife/cookbook_upload.rb +4 -1
  62. data/lib/chef/knife/help.rb +98 -0
  63. data/lib/chef/rest.rb +1 -0
  64. data/lib/chef/version.rb +1 -1
  65. metadata +58 -11
  66. data/distro/common/man/man1/chef-indexer.1 +0 -42
  67. data/distro/common/man/man1/chef-solr-indexer.1 +0 -55
  68. data/distro/common/man/man8/chef-solr-rebuild.8 +0 -37
  69. data/distro/common/man/man8/knife.8 +0 -1349
  70. data/distro/common/markdown/knife.mkd +0 -865
@@ -156,8 +156,13 @@ class Chef
156
156
  # expand any roles in this run_list.
157
157
  expanded_run_list = run_list.expand(environment, 'couchdb', :couchdb => couchdb).recipes.with_version_constraints
158
158
 
159
- cookbooks_for_environment = Chef::Environment.cdb_load_filtered_cookbook_versions(environment, couchdb)
160
- constrain(cookbooks_for_environment, expanded_run_list)
159
+ cookbooks_for_environment = Chef::Environment.cdb_minimal_filtered_versions(environment, couchdb)
160
+ cookbook_collection = constrain(cookbooks_for_environment, expanded_run_list)
161
+ full_cookbooks = Chef::MinimalCookbookVersion.load_full_versions_of(cookbook_collection.values, couchdb)
162
+ full_cookbooks.inject({}) do |cb_map, cookbook_version|
163
+ cb_map[cookbook_version.name] = cookbook_version
164
+ cb_map
165
+ end
161
166
  end
162
167
  end
163
168
  end
@@ -355,6 +355,47 @@ class Chef
355
355
  sorted_list
356
356
  end
357
357
 
358
+ # Like +cdb_load_filtered_cookbook_versions+, loads the set of
359
+ # cookbooks available in a given environment. The difference is that
360
+ # this method will load Chef::MinimalCookbookVersion objects that
361
+ # contain only the information necessary for solving a cookbook
362
+ # collection for a given run list. The user of this method must call
363
+ # Chef::MinimalCookbookVersion.load_full_versions_of() after solving
364
+ # the cookbook collection to get the full objects.
365
+ # === Returns
366
+ # Hash
367
+ # i.e.
368
+ # {
369
+ # "cookbook_name" => [ Chef::CookbookVersion ... ] ## the array of CookbookVersions is sorted highest to lowest
370
+ # }
371
+ #
372
+ # There will be a key for every cookbook. If no CookbookVersions
373
+ # are available for the specified environment the value will be an
374
+ # empty list.
375
+ def self.cdb_minimal_filtered_versions(name, couchdb=nil)
376
+ version_constraints = cdb_load(name, couchdb).cookbook_versions.inject({}) {|res, (k,v)| res[k] = Chef::VersionConstraint.new(v); res}
377
+
378
+ # inject all cookbooks into the hash while filtering out restricted versions, then sort the individual arrays
379
+ cookbook_list = Chef::MinimalCookbookVersion.load_all(couchdb)
380
+
381
+ filtered_list = cookbook_list.inject({}) do |res, cookbook|
382
+ # FIXME: should cookbook.version return a Chef::Version?
383
+ version = Chef::Version.new(cookbook.version)
384
+ requirement_satisfied = version_constraints.has_key?(cookbook.name) ? version_constraints[cookbook.name].include?(version) : true
385
+ # we want a key for every cookbook, even if no versions are available
386
+ res[cookbook.name] ||= []
387
+ res[cookbook.name] << cookbook if requirement_satisfied
388
+ res
389
+ end
390
+
391
+ sorted_list = filtered_list.inject({}) do |res, (cookbook_name, versions)|
392
+ res[cookbook_name] = versions.sort.reverse
393
+ res
394
+ end
395
+
396
+ sorted_list
397
+ end
398
+
358
399
  def self.cdb_load_filtered_recipe_list(name, couchdb=nil)
359
400
  cdb_load_filtered_cookbook_versions(name, couchdb).map do |cb_name, cb|
360
401
  cb.first.recipe_filenames_by_name.keys.map do |recipe|
@@ -24,6 +24,10 @@ class Chef
24
24
  attr_reader :chef_server, :new_client_name, :admin_client_name, :admin_client_key
25
25
  attr_reader :chef_repo, :new_client_key, :validation_client_name, :validation_key
26
26
 
27
+ deps do
28
+ Chef::Knife::ClientCreate.load_deps
29
+ end
30
+
27
31
  banner "knife configure (options)"
28
32
 
29
33
  option :repository,
@@ -150,7 +150,10 @@ class Chef
150
150
  # if only you people wouldn't put broken symlinks in your cookbooks in
151
151
  # the first place. ;)
152
152
  def check_for_broken_links(cookbook)
153
- broken_files = cookbook.manifest_records_by_path.select do |path, info|
153
+ # MUST!! dup the cookbook version object--it memoizes its
154
+ # manifest object, but the manifest becomes invalid when you
155
+ # regenerate the metadata
156
+ broken_files = cookbook.dup.manifest_records_by_path.select do |path, info|
154
157
  info[CHECKSUM].nil? || info[CHECKSUM] !~ MATCH_CHECKSUM
155
158
  end
156
159
  unless broken_files.empty?
@@ -0,0 +1,98 @@
1
+ #
2
+ # Author:: Daniel DeLeo (<dan@opscode.com>)
3
+ # Copyright:: Copyright (c) 2011 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ class Chef
20
+ class Knife
21
+ class Help < Chef::Knife
22
+
23
+ banner "knife help [list|TOPIC]"
24
+
25
+ def run
26
+ if name_args.empty?
27
+ ui.info "Usage: knife SUBCOMMAND (options)"
28
+ show_usage
29
+ ui.msg ""
30
+ ui.info "For further help:"
31
+ ui.info(<<-MOAR_HELP)
32
+ knife help list list help topics
33
+ knife help knife show general knife help
34
+ knife help TOPIC display the manual for TOPIC
35
+ knife COMMAND --help show the options for a command
36
+ MOAR_HELP
37
+ exit 1
38
+ else
39
+ @query = name_args.join('-')
40
+ end
41
+
42
+
43
+
44
+ case @query
45
+ when 'topics', 'list'
46
+ print_help_topics
47
+ exit 1
48
+ when 'intro', 'knife'
49
+ @topic = 'knife'
50
+ else
51
+ @topic = find_manpages_for_query(@query)
52
+ end
53
+
54
+ manpage_path = available_manpages_by_basename[@topic]
55
+ exec "man #{manpage_path}"
56
+ end
57
+
58
+ def help_topics
59
+ available_manpages_by_basename.keys.map {|c| c.sub(/^knife\-/, '')}.sort
60
+ end
61
+
62
+ def print_help_topics
63
+ ui.info "Available help topics are: "
64
+ help_topics.each do |topic|
65
+ ui.msg " #{topic}"
66
+ end
67
+ end
68
+
69
+ def find_manpages_for_query(query)
70
+ possibilities = available_manpages_by_basename.keys.select do |manpage|
71
+ ::File.fnmatch("knife-#{query}*", manpage) || ::File.fnmatch("#{query}*", manpage)
72
+ end
73
+ if possibilities.empty?
74
+ ui.error "No help found for '#{query}'"
75
+ ui.msg ""
76
+ print_help_topics
77
+ exit 1
78
+ elsif possibilities.size == 1
79
+ possibilities.first
80
+ else
81
+ ui.info "Multiple help topics match your query. Pick one:"
82
+ ui.highline.choose(*possibilities)
83
+ end
84
+ end
85
+
86
+ def available_manpages_by_basename
87
+ @available_manpages_by_basename ||= begin
88
+ available_manpages = Dir[File.expand_path("../distro/common/man/man1/*1", CHEF_ROOT)]
89
+ available_manpages.inject({}) do |map, manpath|
90
+ map[::File.basename(manpath, '.1')] = manpath
91
+ map
92
+ end
93
+ end
94
+ end
95
+
96
+ end
97
+ end
98
+ end
@@ -367,6 +367,7 @@ class Chef
367
367
  headers["Content-Type"] = 'application/json' if json_body
368
368
  headers['Content-Length'] = json_body.bytesize.to_s if json_body
369
369
  headers.merge!(authentication_headers(method, url, json_body)) if sign_requests?
370
+ headers.merge!(Chef::Config[:custom_http_headers]) if Chef::Config[:custom_http_headers]
370
371
  headers
371
372
  end
372
373
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  class Chef
19
19
  CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
- VERSION = '0.10.0.beta.7'
20
+ VERSION = '0.10.0.beta.8'
21
21
  end
22
22
 
23
23
  # NOTE: the Chef::Version class is defined in version_class.rb
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 7
5
- version: 0.10.0.beta.7
5
+ version: 0.10.0.beta.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Adam Jacob
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-06 00:00:00 -07:00
13
+ date: 2011-04-08 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -209,17 +209,63 @@ files:
209
209
  - distro/arch/etc/rc.d/chef-server-webui
210
210
  - distro/arch/etc/rc.d/chef-solr
211
211
  - distro/arch/etc/rc.d/chef-solr-indexer
212
- - distro/common/man/man1/chef-indexer.1
213
- - distro/common/man/man1/chef-server-webui.1
214
- - distro/common/man/man1/chef-server.1
215
- - distro/common/man/man1/chef-solr-indexer.1
216
- - distro/common/man/man1/chef-solr.1
212
+ - distro/common/html/knife-bootstrap.1.html
213
+ - distro/common/html/knife-client.1.html
214
+ - distro/common/html/knife-configure.1.html
215
+ - distro/common/html/knife-cookbook-site.1.html
216
+ - distro/common/html/knife-cookbook.1.html
217
+ - distro/common/html/knife-data-bag.1.html
218
+ - distro/common/html/knife-environment.1.html
219
+ - distro/common/html/knife-exec.1.html
220
+ - distro/common/html/knife-index.1.html
221
+ - distro/common/html/knife-node.1.html
222
+ - distro/common/html/knife-recipe.1.html
223
+ - distro/common/html/knife-role.1.html
224
+ - distro/common/html/knife-search.1.html
225
+ - distro/common/html/knife-ssh.1.html
226
+ - distro/common/html/knife-status.1.html
227
+ - distro/common/html/knife-tag.1.html
228
+ - distro/common/html/knife.1.html
229
+ - distro/common/man/man1/knife-bootstrap.1
230
+ - distro/common/man/man1/knife-client.1
231
+ - distro/common/man/man1/knife-configure.1
232
+ - distro/common/man/man1/knife-cookbook-site.1
233
+ - distro/common/man/man1/knife-cookbook.1
234
+ - distro/common/man/man1/knife-data-bag.1
235
+ - distro/common/man/man1/knife-environment.1
236
+ - distro/common/man/man1/knife-exec.1
237
+ - distro/common/man/man1/knife-index.1
238
+ - distro/common/man/man1/knife-node.1
239
+ - distro/common/man/man1/knife-recipe.1
240
+ - distro/common/man/man1/knife-role.1
241
+ - distro/common/man/man1/knife-search.1
242
+ - distro/common/man/man1/knife-ssh.1
243
+ - distro/common/man/man1/knife-status.1
244
+ - distro/common/man/man1/knife-tag.1
245
+ - distro/common/man/man1/knife.1
246
+ - distro/common/man/man1/shef.1
217
247
  - distro/common/man/man8/chef-client.8
248
+ - distro/common/man/man8/chef-server-webui.8
249
+ - distro/common/man/man8/chef-server.8
218
250
  - distro/common/man/man8/chef-solo.8
219
- - distro/common/man/man8/chef-solr-rebuild.8
220
- - distro/common/man/man8/knife.8
221
- - distro/common/man/man8/shef.8
222
- - distro/common/markdown/knife.mkd
251
+ - distro/common/man/man8/chef-solr.8
252
+ - distro/common/markdown/man1/knife-bootstrap.mkd
253
+ - distro/common/markdown/man1/knife-client.mkd
254
+ - distro/common/markdown/man1/knife-configure.mkd
255
+ - distro/common/markdown/man1/knife-cookbook-site.mkd
256
+ - distro/common/markdown/man1/knife-cookbook.mkd
257
+ - distro/common/markdown/man1/knife-data-bag.mkd
258
+ - distro/common/markdown/man1/knife-environment.mkd
259
+ - distro/common/markdown/man1/knife-exec.mkd
260
+ - distro/common/markdown/man1/knife-index.mkd
261
+ - distro/common/markdown/man1/knife-node.mkd
262
+ - distro/common/markdown/man1/knife-recipe.mkd
263
+ - distro/common/markdown/man1/knife-role.mkd
264
+ - distro/common/markdown/man1/knife-search.mkd
265
+ - distro/common/markdown/man1/knife-ssh.mkd
266
+ - distro/common/markdown/man1/knife-status.mkd
267
+ - distro/common/markdown/man1/knife-tag.mkd
268
+ - distro/common/markdown/man1/knife.mkd
223
269
  - distro/common/markdown/README
224
270
  - distro/debian/etc/default/chef-client
225
271
  - distro/debian/etc/default/chef-server
@@ -347,6 +393,7 @@ files:
347
393
  - lib/chef/knife/environment_list.rb
348
394
  - lib/chef/knife/environment_show.rb
349
395
  - lib/chef/knife/exec.rb
396
+ - lib/chef/knife/help.rb
350
397
  - lib/chef/knife/index_rebuild.rb
351
398
  - lib/chef/knife/node_bulk_delete.rb
352
399
  - lib/chef/knife/node_create.rb
@@ -1,42 +0,0 @@
1
- .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
2
- .TH CHEF-INDEXER: "1" "August 2009" "chef-indexer 0.7.8" "User Commands"
3
- .SH NAME
4
- chef-indexer: \- Runs the search index process.
5
- .SH SYNOPSIS
6
- .B chef-indexer
7
- \fI(options)\fR
8
- .SH DESCRIPTION
9
- .TP
10
- chef-indexer requires that the stompserver be started but at this time the stompserver package does not install a startup script, let alone start the daemon. I am working with the package maintainer for stompserver to include a startup script.
11
- \fB\-c\fR, \fB\-\-config\fR CONFIG
12
- The configuration file to use
13
- .TP
14
- \fB\-d\fR, \fB\-\-daemonize\fR
15
- Daemonize the process
16
- .TP
17
- \fB\-g\fR, \fB\-\-group\fR GROUP
18
- Group to change gid to before daemonizing
19
- .TP
20
- \fB\-l\fR, \fB\-\-log_level\fR LEVEL
21
- Set the log level (debug, info, warn, error, fatal)
22
- .TP
23
- \fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
24
- Set the log file location, defaults to STDOUT \- recommended for daemonizing
25
- .TP
26
- \fB\-u\fR, \fB\-\-user\fR USER
27
- User to change uid to before daemonizing
28
- .TP
29
- \fB\-v\fR, \fB\-\-version\fR
30
- Show chef version
31
- .TP
32
- \fB\-h\fR, \fB\-\-help\fR
33
- Show this message
34
- .SH "SEE ALSO"
35
- Full documentation for Chef and chef-indexer is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
36
- .SH AUTHOR
37
- Chef was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
38
- This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
39
- to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
40
-
41
- On Debian systems, the complete text of the Apache 2.0 License can be found in
42
- /usr/share/common-licenses/Apache-2.0.
@@ -1,55 +0,0 @@
1
- .TH CHEF-SOLR-INDEXER: "1" "March 2010" "chef-solr-indexer" "User Commands"
2
- .SH NAME
3
- chef-solr-indexer: \- manual page for chef-solr-indexer
4
- .SH SYNOPSIS
5
- .B chef-solr-indexer
6
- \fI(options)\fR
7
- .SH DESCRIPTION
8
- .TP
9
- \fB\-\-amqp\-host\fR HOST
10
- The amqp host
11
- .TP
12
- \fB\-\-amqp\-pass\fR PASS
13
- The amqp password
14
- .TP
15
- \fB\-\-amqp\-port\fR PORT
16
- The amqp port
17
- .TP
18
- \fB\-\-amqp\-user\fR USER
19
- The amqp user
20
- .TP
21
- \fB\-\-amqp\-vhost\fR VHOST
22
- The amqp vhost
23
- .TP
24
- \fB\-c\fR, \fB\-\-config\fR CONFIG
25
- The configuration file to use
26
- .TP
27
- \fB\-d\fR, \fB\-\-daemonize\fR
28
- Daemonize the process
29
- .TP
30
- \fB\-g\fR, \fB\-\-group\fR GROUP
31
- Group to set privilege to
32
- .TP
33
- \fB\-l\fR, \fB\-\-log_level\fR LEVEL
34
- Set the log level (debug, info, warn, error, fatal)
35
- .TP
36
- \fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
37
- Set the log file location, defaults to STDOUT \- recommended for daemonizing
38
- .TP
39
- \fB\-u\fR, \fB\-\-user\fR USER
40
- User to set privilege to
41
- .TP
42
- \fB\-v\fR, \fB\-\-version\fR
43
- Show chef\-solr\-indexer version
44
- .TP
45
- \fB\-h\fR, \fB\-\-help\fR
46
- Show this message
47
- .SH "SEE ALSO"
48
- Full documentation for Chef and chef-solr is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
49
- .SH AUTHOR
50
- chef-solr-indexer was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
51
- This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
52
- to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
53
-
54
- On Debian systems, the complete text of the Apache 2.0 License can be found in
55
- /usr/share/common-licenses/Apache-2.0.
@@ -1,37 +0,0 @@
1
- .TH CHEF-SOLR-REBUILD: "1" "March 2010" "chef-solr-rebuild" "User Commands"
2
- .SH NAME
3
- chef-solr-rebuild: \- manual page for chef-solr-rebuild
4
- .SH SYNOPSIS
5
- .B chef-solr-rebuild
6
- \fI(options)\fR
7
- .SH DESCRIPTION
8
- .TP
9
- \fB\-c\fR, \fB\-\-config\fR CONFIG
10
- The configuration file to use
11
- .TP
12
- \fB\-d\fR, \fB\-\-couchdb\-database\fR DB
13
- The CouchDB Database to re\-index
14
- .TP
15
- \fB\-u\fR, \fB\-\-couchdb\-url\fR URL
16
- The CouchDB URL
17
- .TP
18
- \fB\-l\fR, \fB\-\-log_level\fR LEVEL
19
- Set the log level (debug, info, warn, error, fatal)
20
- .TP
21
- \fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
22
- Set the log file location, defaults to STDOUT \- recommended for daemonizing
23
- .TP
24
- \fB\-v\fR, \fB\-\-version\fR
25
- Show chef\-solr\-rebuild version
26
- .TP
27
- \fB\-h\fR, \fB\-\-help\fR
28
- Show this message
29
- .SH "SEE ALSO"
30
- Full documentation for Chef and chef-solr is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home.
31
- .SH AUTHOR
32
- chef-solr-rebuild was written by Adam Jacob <adam@ospcode.com> of Opscode (http://www.opscode.com), with contributions from the community.
33
- This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
34
- to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
35
-
36
- On Debian systems, the complete text of the Apache 2.0 License can be found in
37
- /usr/share/common-licenses/Apache-2.0.
@@ -1,1349 +0,0 @@
1
- .\" generated with Ronn/v0.7.3
2
- .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
- .
4
- .TH "KNIFE" "8" "September 2010" "" ""
5
- .
6
- .SH "NAME"
7
- \fBknife\fR \- Chef Server REST API utility
8
- .
9
- .SH "SYNOPSIS"
10
- \fBknife\fR \fIsub\-command\fR \fI(options)\fR
11
- .
12
- .SH "DESCRIPTION"
13
- This manual page documents knife, a command\-line utility used to interact with a Chef server directly through the RESTful API\. Knife uses sub\-commands to take various actions on different types of Chef objects\. Some sub\-commands take additional options\. General options follow sub\-commands and their options\. A configuration file can be created for common defaults\.
14
- .
15
- .P
16
- Unless otherwise specified, output is in JSON format, and input files are also JSON format\.
17
- .
18
- .P
19
- The Chef class \fBChef::Config\fR that configures the behavior of how knife runs has options that correspond to command\-line options\. These are noted as \fBChef::Config\fR values\.
20
- .
21
- .SH "GENERAL OPTIONS"
22
- .
23
- .TP
24
- \fB\-s\fR, \fB\-\-server\-url\fR URL
25
- Chef Server URL, corresponds to \fBChef::Config\fR \fBchef_server_url\fR\.
26
- .
27
- .TP
28
- \fB\-k\fR, \fB\-\-key\fR KEY
29
- API Client Key, corresponds to \fBChef::Config\fR \fBclient_key\fR\.
30
- .
31
- .TP
32
- \fB\-c\fR, \fB\-\-config\fR CONFIG
33
- The configuration file to use
34
- .
35
- .TP
36
- \fB\-e\fR, \fB\-\-editor\fR EDITOR
37
- Set the editor to use for interactive commands
38
- .
39
- .TP
40
- \fB\-F\fR, \fB\-\-format\fR FORMAT
41
- Which format to use for output
42
- .
43
- .TP
44
- \fB\-l\fR, \fB\-\-log_level\fR LEVEL
45
- Set the log level (debug, info, warn, error, fatal), corresponds to \fBChef::Config\fR \fBlog_level\fR\.
46
- .
47
- .TP
48
- \fB\-L\fR, \fB\-\-logfile\fR LOGLOCATION
49
- Set the log file location, defaults to STDOUT, corresponds to \fBChef::Config\fR \fBlog_location\fR\.
50
- .
51
- .TP
52
- \fB\-n\fR, \fB\-\-no\-editor\fR
53
- Do not open EDITOR, just accept the data as is
54
- .
55
- .TP
56
- \fB\-u\fR, \fB\-\-user\fR USER
57
- API Client Username, corresponds to \fBChef::Config\fR \fBnode_name\fR\.
58
- .
59
- .TP
60
- \fB\-p\fR, \fB\-\-print\-after\fR
61
- Show the data after a destructive operation
62
- .
63
- .TP
64
- \fB\-v\fR, \fB\-\-version\fR
65
- Show chef version
66
- .
67
- .TP
68
- \fB\-y\fR, \fB\-\-yes\fR
69
- Say yes to all prompts for confirmation
70
- .
71
- .TP
72
- \fB\-h\fR, \fB\-\-help\fR
73
- Show this message
74
- .
75
- .P
76
- Usage information for sub\-commands can be displayed with \fBknife SUB\-COMMAND \-\-help\fR\.
77
- .
78
- .SH "SUB\-COMMANDS"
79
- Knife sub\-commands are structured as \fINOUN verb NOUN (options)\fR\. The sub\-commands are meant to be intuitively named\. Because the Chef Server API is RESTful, sub\-commands generally utilize CRUD operations\.
80
- .
81
- .IP "\(bu" 4
82
- create (create)
83
- .
84
- .IP "\(bu" 4
85
- list and show (read)
86
- .
87
- .IP "\(bu" 4
88
- edit (update)
89
- .
90
- .IP "\(bu" 4
91
- delete (destroy)
92
- .
93
- .IP "" 0
94
- .
95
- .P
96
- Objects stored on the server support these, as described below\.
97
- .
98
- .SH "GENERAL SUB\-COMMANDS"
99
- The following are general sub\-commands that do not fit within the other object types utilized in the Chef Server API\.
100
- .
101
- .P
102
- \fBconfigure\fR \fI(options)\fR
103
- .
104
- .TP
105
- \fB\-i\fR, \fB\-\-initial\fR
106
- Create an initial API Client
107
- .
108
- .TP
109
- \fB\-r\fR, \fB\-\-repository REPO\fR
110
- The path to your chef\-repo
111
- .
112
- .P
113
- Create a configuration file for knife\. This will prompt for values to enter into the file\. Default values are listed in square brackets if no other entry is typed\. See \fBCONFIGURATION\fR below for available options\.
114
- .
115
- .P
116
- \fBconfigure client DIRECTORY\fR
117
- .
118
- .P
119
- Read the \fBknife\.rb\fR config file and generate a config file suitable for use in \fB/etc/chef/client\.rb\fR and copy the validation certificate into the specified \fIDIRECTORY\fR\.
120
- .
121
- .P
122
- \fBindex rebuild\fR \fI(options)\fR
123
- .
124
- .TP
125
- \fB\-y\fR, \fB\-\-yes\fR
126
- don\'t bother to ask if I\'m sure
127
- .
128
- .P
129
- Rebuilds all the search indexes on the server\.
130
- .
131
- .P
132
- \fBrecipe list [PATTERN]\fR
133
- .
134
- .P
135
- List available recipes from the server\. Specify \fIPATTERN\fR as a regular expression to limit the results\.
136
- .
137
- .P
138
- \fBsearch INDEX QUERY\fR \fI(options)\fR
139
- .
140
- .TP
141
- \fB\-a\fR, \fB\-\-attribute ATTR\fR
142
- Show only one attribute
143
- .
144
- .TP
145
- \fB\-i\fR, \fB\-\-id\-only\fR
146
- Show only the ID of matching objects
147
- .
148
- .TP
149
- \fB\-R\fR, \fB\-\-rows INT\fR
150
- The number of rows to return
151
- .
152
- .TP
153
- \fB\-r\fR, \fB\-\-run\-list\fR
154
- Show only the run list
155
- .
156
- .TP
157
- \fB\-o\fR, \fB\-\-sort SORT\fR
158
- The order to sort the results in
159
- .
160
- .TP
161
- \fB\-b\fR, \fB\-\-start ROW\fR
162
- The row to start returning results at
163
- .
164
- .P
165
- Search indexes are a feature of the Chef Server and the search sub\-command allows querying any of the available indexes using SOLR query syntax\. The following data types are indexed for search: \fInode\fR, \fIrole\fR, \fIclient\fR, \fIdata bag\fR\.
166
- .
167
- .P
168
- \fBssh QUERY COMMAND\fR \fI(options)\fR
169
- .
170
- .TP
171
- \fB\-a\fR, \fB\-\-attribute ATTR\fR
172
- The attribute to use for opening the connection \- default is fqdn
173
- .
174
- .TP
175
- \fB\-C\fR, \fB\-\-concurrency NUM\fR
176
- The number of concurrent connections
177
- .
178
- .TP
179
- \fB\-m\fR, \fB\-\-manual\-list\fR
180
- QUERY is a space separated list of servers
181
- .
182
- .TP
183
- \fB\-P\fR, \fB\-\-ssh\-password PASSWORD\fR
184
- The ssh password
185
- .
186
- .TP
187
- \fB\-x\fR, \fB\-\-ssh\-user USERNAME\fR
188
- The ssh username
189
- .
190
- .P
191
- The \fIssh\fR sub\-command opens an ssh session to each of the nodes in the search results of the \fIQUERY\fR\. This sub\-command requires that the net\-ssh\-multi and highline Ruby libraries are installed\. On Debian systems, these are the libnet\-ssh\-multi\-ruby and libhighline\-ruby packages\. They can also be installed as RubyGems (net\-ssh\-multi and highline, respectively)\.
192
- .
193
- .P
194
- \fBstatus\fR \fI(options)\fR
195
- .
196
- .TP
197
- \fB\-r\fR, \fB\-\-run\-list RUN_LIST\fR
198
- Show the run list
199
- .
200
- .P
201
- The \fIstatus\fR sub\-command searches the Chef Server for all nodes and displays information about the last time the node checked into the server and executed a \fBnode\.save\fR\. The fields displayed are the relative checkin time, the node name, it\'s operating system platform and version, the fully\-qualified domain name and the default IP address\. If the \fB\-r\fR option is given, the node\'s run list will also be displayed\. Note that depending on the configuration of the nodes, the FQDN and IP displayed may not be publicly reachable\.
202
- .
203
- .SH "BOOTSTRAP SUB\-COMMANDS"
204
- \fBbootstrap FQDN\fR \fI(options)\fR
205
- .
206
- .TP
207
- \fB\-i\fR, \fB\-\-identity\-file IDENTITY_FILE\fR
208
- The SSH identity file used for authentication
209
- .
210
- .TP
211
- \fB\-N\fR, \fB\-\-node\-name NAME\fR
212
- The Chef node name for your new node
213
- .
214
- .TP
215
- \fB\-P\fR, \fB\-\-ssh\-password PASSWORD\fR
216
- The ssh password
217
- .
218
- .TP
219
- \fB\-x\fR, \fB\-\-ssh\-user USERNAME\fR
220
- The ssh username
221
- .
222
- .TP
223
- \fB\-\-prerelease\fR
224
- Install pre\-release Chef gems
225
- .
226
- .TP
227
- \fB\-r\fR, \fB\-\-run\-list RUN_LIST\fR
228
- Comma separated list of roles/recipes to apply
229
- .
230
- .TP
231
- \fB\-P\fR, \fB\-\-ssh\-password PASSWORD\fR
232
- The ssh password
233
- .
234
- .TP
235
- \fB\-x\fR, \fB\-\-ssh\-user USERNAME\fR
236
- The ssh username
237
- .
238
- .TP
239
- \fB\-\-template\-file TEMPLATE\fR
240
- Full path to location of template to use
241
- .
242
- .TP
243
- \fB\-\-sudo\fR
244
- Execute the bootstrap via sudo
245
- .
246
- .TP
247
- \fB\-d\fR, \fB\-\-distro DISTRO\fR
248
- Bootstrap a distro using a template
249
- .
250
- .P
251
- Performs a Chef Bootstrap on the target node\. The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server\. The main assumption is a baseline OS installation exists\. This sub\-command is used internally by some cloud computing server create commands and the others will be migrated in a future version of Chef\.
252
- .
253
- .P
254
- As of Chef 0\.9\.8, the bootstrap sub\-command supports supplying a template to perform the bootstrap steps\. If the distro is not specified (via \fB\-d\fR or \fB\-\-distro\fR option), an Ubuntu 10\.04 with RubyGems is assumed\. The \fBDISTRO\fR value corresponds to the base filename of the template, in other words \fBDISTRO\fR\.erb\. A template file can be specified with the \fB\-\-template\-file\fR option in which case the \fBDISTRO\fR is not used\. The sub\-command looks in the following locations for the template to use:
255
- .
256
- .IP "\(bu" 4
257
- \fBbootstrap\fR directory in the installed Chef Knife library\.
258
- .
259
- .IP "\(bu" 4
260
- \fBbootstrap\fR directory in the \fB$PWD/\.chef\fR\.
261
- .
262
- .IP "\(bu" 4
263
- \fBbootstrap\fR directory in the users \fB$HOME/\.chef\fR\.
264
- .
265
- .IP "" 0
266
- .
267
- .P
268
- The default bootstrap templates are scripts that get copied to the target node (FQDN)\. As of Chef 0\.9\.8, the following distros are supported:
269
- .
270
- .IP "\(bu" 4
271
- centos5\-gems
272
- .
273
- .IP "\(bu" 4
274
- fedora13\-gems
275
- .
276
- .IP "\(bu" 4
277
- ubuntu10\.04\-gems
278
- .
279
- .IP "\(bu" 4
280
- ubuntu10\.04\-apt
281
- .
282
- .IP "" 0
283
- .
284
- .P
285
- The gems installations will use RubyGems 1\.3\.6 and Chef installed as a gem\. The apt installation will use the Opscode APT repository\. The RubyGems installation requires installing gems with native extensions, so development related packages (ruby\-dev, build\-essential) are installed\. These are not installed with the apt installation, as native extensions are already compiled in the required packages\.
286
- .
287
- .P
288
- In addition to handling the software installation, these bootstrap templates do the following:
289
- .
290
- .IP "\(bu" 4
291
- Write the validation\.pem per the local knife configuration\.
292
- .
293
- .IP "\(bu" 4
294
- Write a default config file for Chef (\fB/etc/chef/client\.rb\fR) using values from the \fBknife\.rb\fR\.
295
- .
296
- .IP "\(bu" 4
297
- Create a JSON attributes file containing the specified run list and run Chef\.
298
- .
299
- .IP "" 0
300
- .
301
- .P
302
- In the case of the RubyGems, the \fBclient\.rb\fR will be written from scratch with a minimal set of values; see \fBEXAMPLES\fR\. In the case of APT Package installation, \fBclient\.rb\fR will have the \fBvalidation_client_name\fR appended if it is not set to \fBchef\-validator\fR (default config value), and the \fBnode_name\fR will be added if \fBchef_node_name\fR option is specified\.
303
- .
304
- .P
305
- When this is complete, the bootstrapped node will have:
306
- .
307
- .IP "\(bu" 4
308
- Latest Chef version installed from RubyGems or APT Packages from Opscode\. This may be a later version than the local system\.
309
- .
310
- .IP "\(bu" 4
311
- Be validated with the configured Chef Server\.
312
- .
313
- .IP "\(bu" 4
314
- Have run Chef with its default run list if one is specfied\.
315
- .
316
- .IP "" 0
317
- .
318
- .P
319
- Additional custom bootstrap templates can be created and stored in \fB\.chef/bootstrap/DISTRO\.erb\fR, replacing \fBDISTRO\fR with the value passed with the \fB\-d\fR or \fB\-\-distro\fR option\. See \fBEXAMPLES\fR for more information\.
320
- .
321
- .SH "CLIENT SUB\-COMMANDS"
322
- Clients are entities that communicate with the Chef Server API\.
323
- .
324
- .P
325
- \fBclient bulk delete REGEX\fR \fI(options)\fR
326
- .
327
- .P
328
- Delete clients on the Chef Server based on a regular expression\. The regular expression (\fIREGEX\fR) should be in quotes, not in //\'s\.
329
- .
330
- .P
331
- \fBclient create CLIENT\fR \fI(options)\fR
332
- .
333
- .TP
334
- \fB\-a\fR, \fB\-\-admin\fR
335
- Create the client as an admin
336
- .
337
- .TP
338
- \fB\-f\fR, \fB\-\-file FILE\fR
339
- Write the key to a file
340
- .
341
- .P
342
- Create a new client\. This generates an RSA keypair\. The private key will be displayed on \fISTDOUT\fR or written to the named file\. The public half will be stored on the Server\. For \fIchef\-client\fR systems, the private key should be copied to the system as \fB/etc/chef/client\.pem\fR\.
343
- .
344
- .P
345
- Admin clients should be created for users that will use \fIknife\fR to access the API as an administrator\. The private key will generally be copied to \fB~/\.chef/CLIENT\.pem\fR and referenced in the \fBknife\.rb\fR configuration file\.
346
- .
347
- .P
348
- \fBclient delete CLIENT\fR \fI(options)\fR
349
- .
350
- .P
351
- Deletes a registered client\.
352
- .
353
- .P
354
- \fBclient edit CLIENT\fR \fI(options)\fR
355
- .
356
- .P
357
- Edit a registered client\.
358
- .
359
- .P
360
- \fBclient list\fR \fI(options)\fR
361
- .
362
- .TP
363
- \fB\-w\fR, \fB\-\-with\-uri\fR
364
- Show corresponding URIs
365
- .
366
- .P
367
- List all registered clients\.
368
- .
369
- .P
370
- \fBclient reregister CLIENT\fR \fI(options)\fR
371
- .
372
- .TP
373
- \fB\-f\fR, \fB\-\-file FILE\fR
374
- Write the key to a file
375
- .
376
- .P
377
- Regenerate the RSA keypair for a client\. The public half will be stored on the server and the private key displayed on \fISTDOUT\fR or written to the named file\.
378
- .
379
- .P
380
- \fBclient show CLIENT\fR \fI(options)\fR
381
- .
382
- .TP
383
- \fB\-a\fR, \fB\-\-attribute ATTR\fR
384
- Show only one attribute
385
- .
386
- .P
387
- Show a client\.
388
- .
389
- .SH "COOKBOOK SUB\-COMMANDS"
390
- Cookbooks are the fundamental unit of distribution in Chef\. They encapsulate all recipes of resources and assets used to configure a particular aspect of the infrastructure\. The following sub\-commands can be used to manipulate the cookbooks stored on the Chef Server\.
391
- .
392
- .P
393
- \fBcookbook bulk delete REGEX\fR \fI(options)\fR
394
- .
395
- .TP
396
- \fB\-p\fR, \fB\-\-purge\fR
397
- Purge files from backing store\. This will disable any cookbook that contains any of the same files as the cookbook being purged\.
398
- .
399
- .P
400
- Delete cookbooks on the Chef Server based on a regular expression\. The regular expression (\fIREGEX\fR) should be in quotes, not in //\'s\.
401
- .
402
- .P
403
- \fBcookbook create COOKBOOK\fR \fI(options)\fR
404
- .
405
- .TP
406
- \fB\-o\fR, \fB\-\-cookbook\-path PATH\fR
407
- The directory where the cookbook will be created
408
- .
409
- .TP
410
- \fB\-r\fR, \fB\-\-readme\-format FORMAT\fR
411
- Format of the README file
412
- .
413
- .TP
414
- \fB\-C\fR, \fB\-\-copyright COPYRIGHT\fR
415
- Name of Copyright holder
416
- .
417
- .TP
418
- \fB\-I\fR, \fB\-\-license LICENSE\fR
419
- License for cookbook, apachev2 or none
420
- .
421
- .TP
422
- \fB\-E\fR, \fB\-\-email EMAIL\fR
423
- Email address of cookbook maintainer
424
- .
425
- .P
426
- This is a helper command that creates a new cookbook directory in the \fBcookbook_path\fR\. The following directories and files are created for the named cookbook\.
427
- .
428
- .IP "\(bu" 4
429
- COOKBOOK/attributes
430
- .
431
- .IP "\(bu" 4
432
- COOKBOOK/definitions
433
- .
434
- .IP "\(bu" 4
435
- COOKBOOK/files/default
436
- .
437
- .IP "\(bu" 4
438
- COOKBOOK/libraries
439
- .
440
- .IP "\(bu" 4
441
- COOKBOOK/metadata\.rb
442
- .
443
- .IP "\(bu" 4
444
- COOKBOOK/providers
445
- .
446
- .IP "\(bu" 4
447
- COOKBOOK/README\.rdoc
448
- .
449
- .IP "\(bu" 4
450
- COOKBOOK/recipes/default\.rb
451
- .
452
- .IP "\(bu" 4
453
- COOKBOOK/resources
454
- .
455
- .IP "\(bu" 4
456
- COOKBOOK/templates/default
457
- .
458
- .IP "" 0
459
- .
460
- .P
461
- Supported README formats are \'rdoc\' (default), \'md\', \'mkd\', \'txt\'\. The README file will be written with the specified extension and a set of helpful starting headers\.
462
- .
463
- .P
464
- Specify \fB\-C\fR or \fB\-\-copyright\fR with the name of the copyright holder as your name or your company/organization name in a quoted string\. If this value is not specified an all\-caps string \fBYOUR_COMPANY_NAME\fR is used which can be easily changed with find/replace\.
465
- .
466
- .P
467
- Specify \fB\-I\fR or \fB\-\-license\fR with the license that the cookbook is distributed under for sharing with other people or posting to the Opscode Cookbooks site\. Be aware of the licenses of files you put inside the cookbook and follow any restrictions they describe\. When using \fBnone\fR (default) or \fBapachev2\fR, comment header text and metadata file are pre\-filled\. The \fBnone\fR license will be treated as non\-redistributable\.
468
- .
469
- .P
470
- Specify \fB\-E\fR or \fB\-\-email\fR with the email address of the cookbook\'s maintainer\. If this value is not specified, an all\-caps string \fBYOUR_EMAIL\fR is used which can easily be changed with find/replace\.
471
- .
472
- .P
473
- The cookbook copyright, license and email settings can be filled in the \fBknife\.rb\fR, for example with default values:
474
- .
475
- .IP "" 4
476
- .
477
- .nf
478
-
479
- cookbook_copyright "YOUR_COMPANY_NAME"
480
- cookbook_license "none"
481
- cookbook_email "YOUR_EMAIL"
482
- .
483
- .fi
484
- .
485
- .IP "" 0
486
- .
487
- .P
488
- \fBcookbook delete COOKBOOK [VERSION]\fR \fI(options)\fR
489
- .
490
- .TP
491
- \fB\-a\fR, \fB\-\-all\fR
492
- Delete all versions
493
- .
494
- .TP
495
- \fB\-p\fR, \fB\-\-purge\fR
496
- Purge files from backing store\. This will disable any cookbook that contains any of the same files as the cookbook being purged\.
497
- .
498
- .P
499
- Delete the specified \fIVERSION\fR of the named \fICOOKBOOK\fR\. If no version is specified, and only one version exists on the server, that version will be deleted\. If multiple versions are available on the server, you will be prompted for a version to delete\.
500
- .
501
- .P
502
- \fBcookbook download COOKBOOK [VERSION]\fR \fI(options)\fR
503
- .
504
- .TP
505
- \fB\-d\fR, \fB\-\-dir DOWNLOAD_DIRECTORY\fR
506
- The directory to download the cookbook into
507
- .
508
- .TP
509
- \fB\-f\fR, \fB\-\-force\fR
510
- Overwrite an existing directory with the download
511
- .
512
- .TP
513
- \fB\-N\fR, \fB\-\-latest\fR
514
- Download the latest version of the cookbook
515
- .
516
- .P
517
- Download a cookbook from the Chef Server\. If no version is specified and only one version exists on the server, that version will be downloaded\. If no version is specified and multiple versions are available on the server, you will be prompted for a version to download\.
518
- .
519
- .P
520
- \fBcookbook list\fR \fI(options)\fR
521
- .
522
- .TP
523
- \fB\-w\fR, \fB\-\-with\-uri\fR
524
- Show corresponding URIs
525
- .
526
- .P
527
- List all the cookbooks\.
528
- .
529
- .P
530
- \fBcookbook metadata COOKBOOK\fR \fI(options)\fR
531
- .
532
- .TP
533
- \fB\-a\fR, \fB\-\-all\fR
534
- Generate metadata for all cookbooks, rather than just a single cookbook
535
- .
536
- .TP
537
- \fB\-o\fR, \fB\-\-cookbook\-path PATH:PATH\fR
538
- A colon\-separated path to look for cookbooks in
539
- .
540
- .P
541
- Generate cookbook metadata for the named \fICOOKBOOK\fR\. The \fIPATH\fR used here specifies where the cookbooks directory is located and corresponds to the \fBcookbook_path\fR configuration option\.
542
- .
543
- .P
544
- \fBcookbook metadata from FILE\fR \fI(options)\fR
545
- .
546
- .P
547
- Load the cookbook metadata from a specified file\.
548
- .
549
- .P
550
- \fBcookbook show COOKBOOK [VERSION] [PART] [FILENAME]\fR \fI(options)\fR
551
- .
552
- .TP
553
- \fB\-f\fR, \fB\-\-fqdn FQDN\fR
554
- The FQDN of the host to see the file for
555
- .
556
- .TP
557
- \fB\-p\fR, \fB\-\-platform PLATFORM\fR
558
- The platform to see the file for
559
- .
560
- .TP
561
- \fB\-V\fR, \fB\-\-platform\-version VERSION\fR
562
- The platform version to see the file for
563
- .
564
- .P
565
- Show a particular part of a \fICOOKBOOK\fR for the specified \fIVERSION\fR\. \fIPART\fR can be one of:
566
- .
567
- .IP "\(bu" 4
568
- \fIattributes\fR
569
- .
570
- .IP "\(bu" 4
571
- \fIdefinitions\fR
572
- .
573
- .IP "\(bu" 4
574
- \fIfiles\fR
575
- .
576
- .IP "\(bu" 4
577
- \fIlibraries\fR
578
- .
579
- .IP "\(bu" 4
580
- \fIproviders\fR
581
- .
582
- .IP "\(bu" 4
583
- \fIrecipes\fR
584
- .
585
- .IP "\(bu" 4
586
- \fIresources\fR
587
- .
588
- .IP "\(bu" 4
589
- \fItemplates\fR
590
- .
591
- .IP "" 0
592
- .
593
- .P
594
- \fBcookbook test [COOKBOOKS\.\.\.]\fR \fI(options)\fR
595
- .
596
- .TP
597
- \fB\-a\fR, \fB\-\-all\fR
598
- Test all cookbooks, rather than just a single cookbook
599
- .
600
- .TP
601
- \fB\-o\fR, \fB\-\-cookbook\-path PATH:PATH\fR
602
- A colon\-separated path to look for cookbooks in
603
- .
604
- .P
605
- Test the specified cookbooks for syntax errors\. This uses the built\-in Ruby syntax checking option for files in the cookbook ending in \fB\.rb\fR, and the ERB syntax check for files ending in \fB\.erb\fR (templates)\.
606
- .
607
- .P
608
- \fBcookbook upload [COOKBOOKS\.\.\.]\fR \fI(options)\fR
609
- .
610
- .TP
611
- \fB\-a\fR, \fB\-\-all\fR
612
- Upload all cookbooks, rather than just a single cookbook
613
- .
614
- .TP
615
- \fB\-o\fR, \fB\-\-cookbook\-path PATH:PATH\fR
616
- A colon\-separated path to look for cookbooks in
617
- .
618
- .P
619
- Uploads the specified cookbooks to the Chef Server\. The actual upload executes a number of commands, most of which occur on the local machine\. The cookbook is staged in a temporary location\. Then the \fBcookbook_path\fR (or \fB\-o PATH\fR) is processed to search for the named cookbook, and each occurance is copied in the order specified\. A syntax check is performed a la \fBcookbook test\fR, above\. The metadata is generated, a la \fBcookbook metadata\fR\. A gzip(1)\'ed, tar(1) file is created, and is uploaded to the server\.
620
- .
621
- .SH "COOKBOOK SITE SUB\-COMMANDS"
622
- The following sub\-commands are still in the context of cookbooks, but they make use of Opscode\'s Cookbook Community site, \fIhttp://cookbooks\.opscode\.com/\fR\. That site has an API, and these sub\-commands utilize that API, rather than the Chef Server API\.
623
- .
624
- .P
625
- \fBcookbook site download COOKBOOK [VERSION]\fR \fI(options)\fR
626
- .
627
- .TP
628
- \fB\-f\fR, \fB\-\-file FILE\fR
629
- The filename to write to
630
- .
631
- .P
632
- Downloads a specific cookbook from the Community site, optionally specifying a certain version\.
633
- .
634
- .P
635
- \fBcookbook site list\fR \fI(options)\fR
636
- .
637
- .TP
638
- \fB\-w\fR, \fB\-\-with\-uri\fR
639
- Show corresponding URIs
640
- .
641
- .P
642
- Lists available cookbooks from the Community site\.
643
- .
644
- .P
645
- \fBcookbook site search QUERY\fR \fI(options)\fR
646
- .
647
- .P
648
- Searches the Community site with the specified query\.
649
- .
650
- .P
651
- \fBcookbook site share COOKBOOK CATEGORY\fR \fI(options)\fR
652
- .
653
- .TP
654
- \fB\-k\fR, \fB\-\-key KEY\fR
655
- API Client Key
656
- .
657
- .TP
658
- \fB\-u\fR, \fB\-\-user USER\fR
659
- API Client Username
660
- .
661
- .TP
662
- \fB\-o\fR, \fB\-\-cookbook\-path PATH:PATH\fR
663
- A colon\-separated path to look for cookbooks in
664
- .
665
- .P
666
- Uploads the specified cookbook using the given category to the Opscode cookbooks site\. Requires a login user and certificate for the Opscode Cookbooks site\. See \fBEXAMPLES\fR for usage if the Opscode user and certificate pair are not used for authenticating with the Chef Server\. In other words, if the Chef Server is not the Opscode Platform\.
667
- .
668
- .P
669
- \fBcookbook site unshare COOKBOOK\fR
670
- .
671
- .P
672
- Stops sharing the specified cookbook on the Opscode cookbooks site\.
673
- .
674
- .P
675
- \fBcookbook site show COOKBOOK [VERSION]\fR \fI(options)\fR
676
- .
677
- .P
678
- Shows information from the site about a particular cookbook\.
679
- .
680
- .P
681
- \fBcookbook site vendor COOKBOOK [VERSION]\fR \fI(options)\fR
682
- .
683
- .TP
684
- \fB\-d\fR, \fB\-\-dependencies\fR
685
- Grab dependencies automatically
686
- .
687
- .P
688
- Uses \fBgit\fR version control in conjunction with the cookbook site to download upstream cookbooks\. A new vendor branch is created in git, the cookbook downloaded from the site and untarred, then the master branch is merged\. This allows the user to track upstream changes to cookbooks while merging in customizations\. If \fI\-d\fR is specified, all the cookbooks it depends on (via metadata \fIdependencies\fR) are downloaded and untarred as well, each using their own vendor branch\.
689
- .
690
- .SH "DATA BAG SUB\-COMMANDS"
691
- Data bags are stores of JSON blobs\. These blobs are called items\. They are free form JSON and indexed by the Chef Server\.
692
- .
693
- .P
694
- \fBdata bag create BAG [ITEM]\fR \fI(options)\fR
695
- .
696
- .P
697
- Create a new data bag, or an item in a data bag\.
698
- .
699
- .P
700
- \fBdata bag delete BAG [ITEM]\fR \fI(options)\fR
701
- .
702
- .P
703
- Delete a data bag, or an item from a data bag\.
704
- .
705
- .P
706
- \fBdata bag edit BAG ITEM\fR \fI(options)\fR
707
- .
708
- .P
709
- Edit an item in a data bag\.
710
- .
711
- .P
712
- \fBdata bag from file BAG FILE\fR \fI(options)\fR
713
- .
714
- .P
715
- Load a data bag item from a JSON file\. Looks in the directory \fBdata_bags/BAG/ITEM\.json\fR unless a relative path is specified\.
716
- .
717
- .P
718
- \fBdata bag list\fR \fI(options)\fR
719
- .
720
- .TP
721
- \fB\-w\fR, \fB\-\-with\-uri\fR
722
- Show corresponding URIs
723
- .
724
- .P
725
- List the available data bags\.
726
- .
727
- .P
728
- \fBdata bag show BAG [ITEM]\fR \fI(options)\fR
729
- .
730
- .P
731
- Show a specific data bag or an item in a data bag\.
732
- .
733
- .SH "NODE SUB\-COMMANDS"
734
- Nodes are the entities which are configured with Chef\. Typically these are servers or workstations\. Nodes are registered as a client, by default by the fully qualified domain name (fqdn)\. A single client may configure more than one node\.
735
- .
736
- .P
737
- \fBnode bulk delete REGEX\fR \fI(options)\fR
738
- .
739
- .P
740
- Delete nodes on the Chef Server based on a regular expression\. The regular expression (\fIREGEX\fR) should be in quotes, not in //\'s\.
741
- .
742
- .P
743
- \fBnode create NODE\fR \fI(options)\fR
744
- .
745
- .P
746
- Create a new node\.
747
- .
748
- .P
749
- \fBnode delete NODE\fR \fI(options)\fR
750
- .
751
- .P
752
- Delete a single node\.
753
- .
754
- .P
755
- \fBnode edit NODE\fR \fI(options)\fR
756
- .
757
- .P
758
- Edit a node\.
759
- .
760
- .P
761
- \fBnode from file FILE\fR \fI(options)\fR
762
- .
763
- .P
764
- Create a node from a JSON file\.
765
- .
766
- .P
767
- \fBnode list\fR \fI(options)\fR
768
- .
769
- .TP
770
- \fB\-w\fR, \fB\-\-with\-uri\fR
771
- Show corresponding URIs
772
- .
773
- .P
774
- List all nodes\.
775
- .
776
- .P
777
- \fBnode run_list add [NODE] [ENTRY]\fR \fI(options)\fR
778
- .
779
- .TP
780
- \fB\-a\fR, \fB\-\-after ITEM\fR
781
- Place the ENTRY in the run list after ITEM
782
- .
783
- .P
784
- Add a recipe or role to the node\'s \fBrun_list\fR\.
785
- .
786
- .P
787
- \fBnode run_list remove [NODE] [ENTRY]\fR \fI(options)\fR
788
- .
789
- .P
790
- Remove a recipe or role from the node\'s \fBrun_list\fR\.
791
- .
792
- .P
793
- \fBnode show NODE\fR \fI(options)\fR
794
- .
795
- .TP
796
- \fB\-a\fR, \fB\-\-attribute [ATTR]\fR
797
- Show only one attribute
798
- .
799
- .TP
800
- \fB\-r\fR, \fB\-\-run\-list\fR
801
- Show only the run list
802
- .
803
- .P
804
- Show a node\.
805
- .
806
- .SH "RECIPE SUB\-COMMANDS"
807
- \fBrecipe list [PATTERN]\fR
808
- .
809
- .P
810
- List the recipes available on the server\. The results shown can be limited with the optional PATTERN, which is a regular expression\. PATTERN should be given in quotes, without slashes\.
811
- .
812
- .SH "ROLE SUB\-COMMANDS"
813
- \fBrole bulk delete REGEX\fR \fI(options)\fR
814
- .
815
- .P
816
- Delete roles on the Chef Server based on a regular expression\. The regular expression (\fIREGEX\fR) should be in quotes, not in //\'s\.
817
- .
818
- .P
819
- \fBrole create ROLE\fR \fI(options)\fR
820
- .
821
- .TP
822
- \fB\-d\fR, \fB\-\-description\fR
823
- The role description
824
- .
825
- .P
826
- Create a new role\.
827
- .
828
- .P
829
- \fBrole delete ROLE\fR \fI(options)\fR
830
- .
831
- .P
832
- Delete a role\.
833
- .
834
- .P
835
- \fBrole edit ROLE\fR \fI(options)\fR
836
- .
837
- .P
838
- Edit a role\.
839
- .
840
- .P
841
- \fBrole from file FILE\fR \fI(options)\fR
842
- .
843
- .P
844
- Create or update a role from a role Ruby DSL (\fB\.rb\fR) or JSON file\.
845
- .
846
- .P
847
- \fBrole list\fR \fI(options)\fR
848
- .
849
- .TP
850
- \fB\-w\fR, \fB\-\-with\-uri\fR
851
- Show corresponding URIs
852
- .
853
- .P
854
- List roles\.
855
- .
856
- .P
857
- \fBrole show ROLE\fR \fI(options)\fR
858
- .
859
- .TP
860
- \fB\-a\fR, \fB\-\-attribute ATTR\fR
861
- Show only one attribute
862
- .
863
- .P
864
- Show a specific role\.
865
- .
866
- .SH "CLOUD COMPUTING SUB\-COMMANDS"
867
- The next sections describe sub\-commands to work with various Cloud Computing APIs to launch server instances with validation and run\-time configuration that Chef knows about\. These sub\-commands require the fog Ruby library\. On Debian and Ubuntu systems with Opscode\'s apt repository (apt\.opscode\.com), this is the package \fBlibfog\-ruby\fR\. It is also available as a RubyGem, \fBfog\fR\.
868
- .
869
- .P
870
- The Rackspace and Terremark server creation sub\-commands are at an early stage of development\. They do not yet use the \fBbootstrap\fR sub\-command to install Chef, and make a few assumptions to be aware\. Right now when creating instances of these types, knife will assume an Ubuntu image, install Ruby from packages, RubyGems from source and Chef as a RubyGem\. As these commands are developed further, they will utilize the \fBbootstrap\fR sub\-command\.
871
- .
872
- .P
873
- In order to use knife with the various \fBCLOUD COMPUTING SUB\-COMMANDS\fR, credentials need to be added to the configuration file\. See \fBCONFIGURATION\fR\.
874
- .
875
- .SH "EC2 SUB\-COMMANDS"
876
- Chef is commonly used with Amazon AWS EC2 nodes\. This sub\-command will generate instance metadata that can be used to automatically configure an EC2 instance with Chef\. This requires an AMI that has Chef preinstalled with a configuration file that can parse the metadata at run\-time\. At this time this is the only sub\-command for EC2, but more may be added later similar to \fBRACKSPACE\fR and \fBTERREMARK\fR below\.
877
- .
878
- .P
879
- \fBec2 instance data [RUN LIST\.\.\.]\fR \fI(options)\fR
880
- .
881
- .TP
882
- \fB\-e\fR, \fB\-\-edit\fR
883
- Edit the instance data
884
- .
885
- .P
886
- The \fIRUN LIST\fR should be specified as a space separated list of roles or recipes that will be used by the instance to configure the server\.
887
- .
888
- .P
889
- \fBec2 server create [RUN LIST\.\.\.]\fR \fI(options)\fR
890
- .
891
- .TP
892
- \fB\-Z\fR, \fB\-\-availability\-zone ZONE\fR
893
- The Availability Zone
894
- .
895
- .TP
896
- \fB\-\-region\fR
897
- Your AWS region
898
- .
899
- .TP
900
- \fB\-A\fR, \fB\-\-aws\-access\-key\-id KEY\fR
901
- Your AWS Access Key ID
902
- .
903
- .TP
904
- \fB\-K SECRET\fR, \fB\-\-aws\-secret\-access\-key\fR
905
- Your AWS API Secret Access Key
906
- .
907
- .TP
908
- \fB\-f\fR, \fB\-\-flavor FLAVOR\fR
909
- The flavor of server (m1\.small, m1\.medium, etc)
910
- .
911
- .TP
912
- \fB\-i\fR, \fB\-\-image IMAGE\fR
913
- The AMI for the server
914
- .
915
- .TP
916
- \fB\-G\fR, \fB\-\-groups X,Y,Z\fR
917
- The security groups for this server
918
- .
919
- .TP
920
- \fB\-S\fR, \fB\-\-ssh\-key KEY\fR
921
- The SSH root key, corresponds to an Amazon Keypair\.
922
- .
923
- .TP
924
- \fB\-I\fR, \fB\-\-identity\-file IDENTITY_FILE\fR
925
- The SSH identity file used for authentication, passed to \fBbootstrap\fR\.
926
- .
927
- .TP
928
- \fB\-P\fR, \fB\-\-ssh\-password PASSWORD\fR
929
- The ssh password, passed to \fBbootstrap\fR\.
930
- .
931
- .TP
932
- \fB\-x\fR, \fB\-\-ssh\-user USERNAME\fR
933
- The ssh username, passed to \fBbootstrap\fR\.
934
- .
935
- .TP
936
- \fB\-\-prerelease\fR
937
- Install pre\-release Chef gems, passed to \fBbootstrap\fR\.
938
- .
939
- .TP
940
- \fB\-\-template\-file TEMPLATE\fR
941
- Full path to location of template to use, passed to \fBbootstrap\fR\.
942
- .
943
- .TP
944
- \fB\-d\fR, \fB\-\-distro DISTRO\fR
945
- Bootstrap a distro using a template, passed to \fBbootstrap\fR\.
946
- .
947
- .P
948
- Creates a new Amazon AWS EC2 instance and bootstraps it by calling the \fBbootstrap\fR sub\-command\. The \fB[RUN LIST\.\.\.]\fR items are passed to the bootstrap\'s \fBrun_list\fR config parameter/option\. See the \fBBOOTSTRAP SUB\-COMMANDS\fR section above for more information\.
949
- .
950
- .P
951
- \fBec2 server delete SERVER [SERVER]\fR \fI(options)\fR
952
- .
953
- .TP
954
- \fB\-A\fR, \fB\-\-aws\-access\-key\-id KEY\fR
955
- Your AWS Access Key ID
956
- .
957
- .TP
958
- \fB\-K SECRET\fR, \fB\-\-aws\-secret\-access\-key\fR
959
- Your AWS API Secret Access Key
960
- .
961
- .P
962
- Terminates a running Amazon AWS EC2 instance\.
963
- .
964
- .P
965
- \fBec2 server list [RUN LIST\.\.\.]\fR \fI(options)\fR
966
- .
967
- .TP
968
- \fB\-A\fR, \fB\-\-aws\-access\-key\-id KEY\fR
969
- Your AWS Access Key ID
970
- .
971
- .TP
972
- \fB\-K SECRET\fR, \fB\-\-aws\-secret\-access\-key\fR
973
- Your AWS API Secret Access Key
974
- .
975
- .P
976
- List running Amazon AWS EC2 instances\.
977
- .
978
- .SH "RACKSPACE SUB\-COMMANDS"
979
- In addition to EC2 nodes, Chef can be used on Rackspace Cloud nodes\. The following sub\-commands allow manipulating Rackspace Cloud nodes via the \fBfog\fR library\.
980
- .
981
- .P
982
- \fBrackspace server create [RUN LIST\.\.\.]\fR \fI(options)\fR
983
- .
984
- .TP
985
- \fB\-K\fR, \fB\-\-rackspace\-api\-key KEY\fR
986
- Your rackspace API key
987
- .
988
- .TP
989
- \fB\-A USERNAME\fR, \fB\-\-rackspace\-api\-username\fR
990
- Your rackspace API username
991
- .
992
- .TP
993
- \fB\-f\fR, \fB\-\-flavor FLAVOR\fR
994
- The flavor of server
995
- .
996
- .TP
997
- \fB\-i\fR, \fB\-\-image IMAGE\fR
998
- The image of the server
999
- .
1000
- .TP
1001
- \fB\-N\fR, \fB\-\-server\-name NAME\fR
1002
- The server name
1003
- .
1004
- .P
1005
- Creates a new Rackspace Cloud server\.
1006
- .
1007
- .P
1008
- \fBrackspace server delete SERVER\fR \fI(options)\fR
1009
- .
1010
- .P
1011
- Deletes a running Rackspace Cloud server\.
1012
- .
1013
- .P
1014
- \fBrackspace server list\fR \fI(options)\fR
1015
- .
1016
- .P
1017
- Lists running Rackspace Cloud servers\.
1018
- .
1019
- .SH "SLICEHOST SUB\-COMMANDS"
1020
- As above, Chef can also be used on Slicehost nodes\. The following sub\-commands allow manipulating Slicehost nodes via the \fBfog\fR library\.
1021
- .
1022
- .P
1023
- \fBslicehost server create [RUN LIST\.\.\.]\fR \fI(options)\fR * \fB\-f\fR, \fB\-\-flavor FLAVOR\fR:
1024
- .
1025
- .IP "" 4
1026
- .
1027
- .nf
1028
-
1029
- The flavor of server
1030
- .
1031
- .fi
1032
- .
1033
- .IP "" 0
1034
- .
1035
- .TP
1036
- \fB\-i\fR, \fB\-\-image IMAGE\fR
1037
- The image of the server
1038
- .
1039
- .TP
1040
- \fB\-N\fR, \fB\-\-server\-name NAME\fR
1041
- The server name
1042
- .
1043
- .TP
1044
- \fB\-K\fR, \fB\-\-slicehost\-password PASSWORD\fR
1045
- Your slicehost API password
1046
- .
1047
- .P
1048
- Creates a new slicehost server\.
1049
- .
1050
- .P
1051
- \fBslicehost server list\fR \fI(options)\fR
1052
- .
1053
- .P
1054
- Lists running Slicehost servers\.
1055
- .
1056
- .P
1057
- \fBslicehost server delete SLICENAME\fR
1058
- .
1059
- .P
1060
- Deletes a running Slicehost server\.
1061
- .
1062
- .P
1063
- \fBslicehost images list\fR
1064
- .
1065
- .P
1066
- Lists the available Slicehost server images to boot\.
1067
- .
1068
- .SH "TERREMARK SUB\-COMMANDS"
1069
- As above, Chef can also be used on Terremark vCloud nodes\. The following sub\-commands allow manipulating Terremark vCloud nodes via the \fBfog\fR library\.
1070
- .
1071
- .P
1072
- \fBterremark server create NAME [RUN LIST\.\.\.]\fR \fI(options)\fR
1073
- .
1074
- .TP
1075
- \fB\-K PASSWORD\fR, \fB\-\-terremark\-password\fR
1076
- Your terremark password
1077
- .
1078
- .TP
1079
- \fB\-S\fR, \fB\-\-terremark\-service SERVICE\fR
1080
- Your terremark service name
1081
- .
1082
- .TP
1083
- \fB\-A USERNAME\fR, \fB\-\-terremark\-username\fR
1084
- Your terremark username
1085
- .
1086
- .P
1087
- Creates a new Terremark vCloud server\.
1088
- .
1089
- .P
1090
- \fBterremark server delete SERVER\fR \fI(options)\fR
1091
- .
1092
- .P
1093
- Deletes a running Terremark vCloud server\.
1094
- .
1095
- .P
1096
- \fBterremark server list\fR \fI(options)\fR
1097
- .
1098
- .TP
1099
- \fB\-K PASSWORD\fR, \fB\-\-terremark\-password\fR
1100
- Your terremark password
1101
- .
1102
- .TP
1103
- \fB\-S\fR, \fB\-\-terremark\-service SERVICE\fR
1104
- Your terremark service name
1105
- .
1106
- .TP
1107
- \fB\-A USERNAME\fR, \fB\-\-terremark\-username\fR
1108
- Your terremark username
1109
- .
1110
- .P
1111
- Lists running Terremark vCloud servers\.
1112
- .
1113
- .SH "CONFIGURATION"
1114
- The knife configuration file is a Ruby DSL to set configuration parameters for Knife\'s \fBGENERAL OPTIONS\fR\. The default location for the config file is \fB~/\.chef/knife\.rb\fR\. If managing multiple Chef repositories, per\-repository config files can be created\. The file must be \fB\.chef/knife\.rb\fR in the current directory of the repository\.
1115
- .
1116
- .P
1117
- If the config file exists, knife uses these settings for \fBGENERAL OPTIONS\fR defaults\.
1118
- .
1119
- .P
1120
- \fBlog_level\fR
1121
- .
1122
- .P
1123
- A Ruby symbol specifying the log level\. Corresponds to \fB\-l\fR or \fB\-\-log_level\fR option\. Default is \fI:info\fR\. Valid values are:
1124
- .
1125
- .IP "\(bu" 4
1126
- :info
1127
- .
1128
- .IP "\(bu" 4
1129
- :debug
1130
- .
1131
- .IP "\(bu" 4
1132
- :warn
1133
- .
1134
- .IP "\(bu" 4
1135
- :fatal
1136
- .
1137
- .IP "" 0
1138
- .
1139
- .P
1140
- \fBlog_location\fR
1141
- .
1142
- .P
1143
- Corresponds to the \fB\-L\fR or \fB\-\-log\-file\fR option\. Defaults is \fBSTDOUT\fR\. Valid values are \fBSTDOUT\fR or a filename\.
1144
- .
1145
- .P
1146
- \fBnode_name\fR
1147
- .
1148
- .P
1149
- User to authenticate to the Chef server\. Corresponds to the \fB\-u\fR or \fB\-\-user\fR option\. This is requested from the user when running this sub\-command\.
1150
- .
1151
- .P
1152
- \fBclient_key\fR
1153
- .
1154
- .P
1155
- Private key file to authenticate to the Chef server\. Corresponds to the \fB\-k\fR or \fB\-\-key\fR option\. This is requested from the user when running this sub\-command\.
1156
- .
1157
- .P
1158
- \fBchef_server_url\fR
1159
- .
1160
- .P
1161
- URL of the Chef server\. Corresponds to the \fB\-s\fR or \fB\-\-server\-url\fR option\. This is requested from the user when running this sub\-command\.
1162
- .
1163
- .P
1164
- \fBcache_type\fR
1165
- .
1166
- .P
1167
- The type of cache to use\. Default is BasicFile\. This can be any type of Cache that moneta supports: BasicFile, Berkeley, Couch, DataMapper, File, LMC, Memcache, Memory, MongoDB, Redis, Rufus, S3, SDBM, Tyrant, Xattr, YAML\.
1168
- .
1169
- .P
1170
- \fBcache_options\fR
1171
- .
1172
- .P
1173
- Specifies various options to use for caching\. Default reads the Chef client configuration (/etc/chef/checksums)\.
1174
- .
1175
- .P
1176
- \fBvalidation_client_name\fR
1177
- .
1178
- .P
1179
- Specifies the name of the client used to validate new clients\. This is requested from the user when running the configuration sub\-command\.
1180
- .
1181
- .P
1182
- \fBvalidation_key\fR
1183
- .
1184
- .P
1185
- Specifies the private key file to use for generating ec2 instance data for validating new clients\. This is implied from the \fBvalidation_client_name\fR\.
1186
- .
1187
- .P
1188
- \fBcookbook_copyright\fR \fBcookbook_email\fR \fBcookbook_license\fR
1189
- .
1190
- .P
1191
- Used by \fBknife cookbook create\fR sub\-command to specify the copyright holder, maintainer email and license (respectively) for new cookbooks\. The copyright holder is listed as the maintainer in the cookbook\'s metadata and as the Copyright in the comments of the default recipe\. The maintainer email is used in the cookbook metadata\. The license determines what preamble to put in the comment of the default recipe, and is listed as the license in the cookbook metadata\. Currently supported licenses are "apachev2" and "none"\. Any other values will result in an empty license in the metadata (needs to be filled in by the author), and no comment preamble in the default recipe\.
1192
- .
1193
- .P
1194
- \fBknife[:aws_access_key_id]\fR \fBknife[:aws_secret_access_key]\fR
1195
- .
1196
- .P
1197
- Specifies the Amazon AWS EC2 credentials to use when running the ec2 sub\-commands\.
1198
- .
1199
- .P
1200
- \fBknife[:rackspace_api_username]\fR \fBknife[:rackspace_api_key]\fR
1201
- .
1202
- .P
1203
- Specifies the Rackspace Cloud credentials to use when running the rackspace sub\-commands\.
1204
- .
1205
- .P
1206
- \fBknife[:terremark_username]\fR \fBknife[:terremark_password]\fR \fBknife[:terremark_service]\fR
1207
- .
1208
- .P
1209
- Specifies the Terremark vCloud credentials to use when running the terremark sub\-commands\.
1210
- .
1211
- .P
1212
- \fBknife[:slicehost_password]\fR
1213
- .
1214
- .P
1215
- Specifies the Slicehost password to use when running the slicdehost sub\-commands\.
1216
- .
1217
- .SH "FILES"
1218
- \fI~/\.chef/knife\.rb\fR
1219
- .
1220
- .P
1221
- Ruby DSL configuration file for knife\. See \fBCONFIGURATION\fR\.
1222
- .
1223
- .SH "CHEF WORKFLOW"
1224
- When working with Chef and Knife in the local repository, the recommended workflow outline looks like:
1225
- .
1226
- .IP "\(bu" 4
1227
- Create repository\. A skeleton sample is provided at \fIhttp://github\.com/opscode/chef\-repo/\fR\.
1228
- .
1229
- .IP "\(bu" 4
1230
- Configure knife, see \fBCONFIGURATION\fR\.
1231
- .
1232
- .IP "\(bu" 4
1233
- Download cookbooks from the Opscode cookbooks site, see \fBCOOKBOOK SITE SUB\-COMMANDS\fR\.
1234
- .
1235
- .IP "\(bu" 4
1236
- Or, create new cookbooks, see \fBcookbook create\fR sub\-command\.
1237
- .
1238
- .IP "\(bu" 4
1239
- Commit changes to the version control system\. See your tool\'s documentation\.
1240
- .
1241
- .IP "\(bu" 4
1242
- Upload cookbooks to the Chef Server, see \fBCOOKBOOK SUB\-COMMANDS\fR\.
1243
- .
1244
- .IP "\(bu" 4
1245
- Launch instances in the Cloud, OR provision new hosts; see \fBCLOUD COMPUTING SUB\-COMMANDS\fR and \fBBOOTSTRAP SUB\-COMMANDS\fR\.
1246
- .
1247
- .IP "\(bu" 4
1248
- Watch Chef configure systems!
1249
- .
1250
- .IP "" 0
1251
- .
1252
- .P
1253
- A note about git: Opscode and many folks in the Chef community use git, but it is not required, except in the case of the \fBcookbook site vendor\fR sub\-command, as it uses git directly\. Version control is strongly recommended though, and git fits with a lot of the workflow paradigms\.
1254
- .
1255
- .SH "EXAMPLES"
1256
- Example client config (\fB/etc/chef/client\.rb\fR) from \fBknife configure client\fR\. The same configuration is used when using the \fBknife bootstrap\fR command with the default \fBgem\fR templates that come with Chef\.
1257
- .
1258
- .IP "" 4
1259
- .
1260
- .nf
1261
-
1262
- log_level :info
1263
- log_location STDOUT
1264
- chef_server_url \'https://api\.opscode\.com/organizations/ORGNAME\'
1265
- validation_client_name \'ORGNAME\-validator\'
1266
- .
1267
- .fi
1268
- .
1269
- .IP "" 0
1270
- .
1271
- .P
1272
- Setting up a custom bootstrap is fairly straightforward\. Create \fB\.chef/bootstrap\fR in your Chef Repository directory or in \fB$HOME/\.chef/bootstrap\fR\. Then create the ERB template file\.
1273
- .
1274
- .IP "" 4
1275
- .
1276
- .nf
1277
-
1278
- mkdir ~/\.chef/bootstrap
1279
- vi ~/\.chef/bootstrap/debian5\.0\-apt\.erb
1280
- .
1281
- .fi
1282
- .
1283
- .IP "" 0
1284
- .
1285
- .P
1286
- For example, to create a new bootstrap template that should be used when setting up a new Debian node\. Edit the template to run the commands, set up the validation certificate and the client configuration file, and finally to run chef\-client on completion\. The bootstrap template can be called with:
1287
- .
1288
- .IP "" 4
1289
- .
1290
- .nf
1291
-
1292
- knife bootstrap mynode\.example\.com \-\-template\-file ~/\.chef/bootstrap/debian5\.0\-apt\.erb
1293
- .
1294
- .fi
1295
- .
1296
- .IP "" 0
1297
- .
1298
- .P
1299
- Or,
1300
- .
1301
- .IP "" 4
1302
- .
1303
- .nf
1304
-
1305
- knife bootstrap mynode\.example\.com \-\-distro debian5\.0\-apt
1306
- .
1307
- .fi
1308
- .
1309
- .IP "" 0
1310
- .
1311
- .P
1312
- The \fB\-\-distro\fR parameter will automatically look in the \fB~/\.chef/bootstrap\fR directory for a file named \fBdebian5\.0\-apt\.erb\fR\.
1313
- .
1314
- .P
1315
- Templates provided by the Chef installation are located in \fBBASEDIR/lib/chef/knife/bootstrap/*\.erb\fR, where \fIBASEDIR\fR is the location where the package or Gem installed the Chef client libraries\.
1316
- .
1317
- .P
1318
- Uploading cookbooks to the Opscode cookbooks site using the user/certificate specifically:
1319
- .
1320
- .IP "" 4
1321
- .
1322
- .nf
1323
-
1324
- knife cookbook site share example Other \-k ~/\.chef/USERNAME\.pem \-u USERNAME
1325
- .
1326
- .fi
1327
- .
1328
- .IP "" 0
1329
- .
1330
- .SH "SEE ALSO"
1331
- Full documentation for Chef is located on the Chef wiki, http://wiki\.opscode\.com/display/chef/Home/\.
1332
- .
1333
- .P
1334
- JSON is JavaScript Object Notation and more information can be found at http://json\.org/\.
1335
- .
1336
- .P
1337
- SOLR is an open source search engine\. The Chef Server includes a SOLR installation\. More information about SOLR, including the search query syntax, can be found at http://lucene\.apache\.org/solr/\.
1338
- .
1339
- .P
1340
- Git is a version control system and documented at http://git\-scm\.com/\.
1341
- .
1342
- .P
1343
- This manual page was generated in nroff from Markdown with ronn\. Ryan Tomayko wrote ronn and more information can be found at http://rtomayko\.github\.com/ronn/ronn\.5\.html\.
1344
- .
1345
- .SH "AUTHOR"
1346
- Chef was written by Adam Jacob \fIadam@opscode\.com\fR of Opscode (http://www\.opscode\.com), with contributions from the community\. This manual page was written by Joshua Timberman \fIjoshua@opscode\.com\fR\. Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2\.0 License\.
1347
- .
1348
- .P
1349
- On Debian systems, the complete text of the Apache 2\.0 License can be found in \fB/usr/share/common\-licenses/Apache\-2\.0\fR\.