summaryrefslogtreecommitdiff
path: root/distro/common/man/man1/knife-cookbook.1
blob: 270e23db77f8b4ffbc12dc2160ee6ca287402df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "KNIFE\-COOKBOOK" "1" "September 2012" "Chef 11.0.0.alpha" "Chef Manual"
.
.SH "NAME"
\fBknife\-cookbook\fR \- upload and manage chef cookbooks
.
.SH "SYNOPSIS"
\fBknife\fR \fBcookbook\fR \fIsub\-command\fR \fI(options)\fR
.
.SH "SUB\-COMMANDS"
\fBknife cookbook\fR supports the following sub commands:
.
.SH "LIST"
\fBknife cookbook list\fR \fI(options)\fR
.
.TP
\fB\-a\fR, \fB\-\-all\fR
show all versions of a cookbook instead of just the most recent
.
.TP
\fB\-w\fR, \fB\-\-with\-uri\fR
show corresponding uris
.
.P
Lists the cookbooks available on the Chef server\.
.
.SH "SHOW"
\fBknife cookbook show cookbook [version] [part] [filename]\fR \fI(options)\fR
.
.TP
\fB\-f\fR, \fB\-\-fqdn fqdn\fR
the fqdn of the host to see the file for
.
.TP
\fB\-p\fR, \fB\-\-platform platform\fR
the platform to see the file for
.
.TP
\fB\-v\fR, \fB\-\-platform\-version version\fR
the platform version to see the file for
.
.TP
\fB\-w\fR, \fB\-\-with\-uri\fR
Show corresponding URIs
.
.P
show a particular part of a \fIcookbook\fR for the specified \fIversion\fR\. \fIpart\fR can be one of:
.
.IP "\(bu" 4
\fIattributes\fR
.
.IP "\(bu" 4
\fIdefinitions\fR
.
.IP "\(bu" 4
\fIfiles\fR
.
.IP "\(bu" 4
\fIlibraries\fR
.
.IP "\(bu" 4
\fIproviders\fR
.
.IP "\(bu" 4
\fIrecipes\fR
.
.IP "\(bu" 4
\fIresources\fR
.
.IP "\(bu" 4
\fItemplates\fR
.
.IP "" 0
.
.SH "UPLOAD"
\fBknife cookbook upload [cookbooks\.\.\.]\fR \fI(options)\fR
.
.TP
\fB\-a\fR, \fB\-\-all\fR
upload all cookbooks, rather than just a single cookbook
.
.TP
\fB\-o\fR, \fB\-\-cookbook\-path path:path\fR
a colon\-separated path to look for cookbooks in
.
.TP
\fB\-d\fR, \fB\-\-upload\-dependencies\fR
Uploads additional cookbooks that this cookbook lists in as dependencies in its metadata\.
.
.TP
\fB\-E\fR, \fB\-\-environment ENVIRONMENT\fR
An \fIENVIRONMENT\fR to apply the uploaded cookbooks to\. Specifying this option will cause knife to edit the \fIENVIRONMENT\fR to place a strict version constraint on the cookbook version(s) uploaded\.
.
.TP
\fB\-\-freeze\fR
Sets the frozen flag on the uploaded cookbook(s) Any future attempt to modify the cookbook without changing the version number will return an error unless \-\-force is specified\.
.
.TP
\fB\-\-force\fR
Overrides the frozen flag on a cookbook, allowing you to overwrite a cookbook version that has previously been uploaded with the \-\-freeze option\.
.
.P
Uploads one or more cookbooks from your local cookbook repository(ies) to the Chef Server\. Only files that don\'t yet exist on the server will be uploaded\.
.
.P
As the command parses the name args as 1\.\.n cookbook names:
.
.IP "" 4
.
.nf

`knife cookbook upload COOKBOOK COOKBOOK \.\.\.`
.
.fi
.
.IP "" 0
.
.P
works for one to many cookbooks\.
.
.SH "DOWNLOAD"
\fBknife cookbook download cookbook [version]\fR \fI(options)\fR
.
.TP
\fB\-d\fR, \fB\-\-dir download_directory\fR
the directory to download the cookbook into
.
.TP
\fB\-f\fR, \fB\-\-force\fR
overwrite an existing directory with the download
.
.TP
\fB\-n\fR, \fB\-\-latest\fR
download the latest version of the cookbook
.
.P
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\.
.
.SH "DELETE"
\fBknife cookbook delete cookbook [version]\fR \fI(options)\fR
.
.TP
\fB\-a\fR, \fB\-\-all\fR
delete all versions
.
.TP
\fB\-p\fR, \fB\-\-purge\fR
purge files from backing store\. this will disable any cookbook that contains any of the same files as the cookbook being purged\.
.
.P
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\.
.
.SH "BULK DELETE"
\fBknife cookbook bulk delete regex\fR \fI(options)\fR
.
.TP
\fB\-p\fR, \fB\-\-purge\fR
purge files from backing store\. this will disable any cookbook that contains any of the same files as the cookbook being purged\.
.
.P
delete cookbooks on the chef server based on a regular expression\. the regular expression (\fIregex\fR) should be in quotes, not in //\'s\.
.
.SH "COOKBOOK CREATE"
\fBknife cookbook create cookbook\fR \fI(options)\fR
.
.TP
\fB\-o\fR, \fB\-\-cookbook\-path path\fR
the directory where the cookbook will be created
.
.TP
\fB\-r\fR, \fB\-\-readme\-format format\fR
format of the readme file md, mkd, txt, rdoc
.
.TP
\fB\-c\fR, \fB\-\-copyright copyright\fR
name of copyright holder
.
.TP
\fB\-i\fR, \fB\-\-license license\fR
license for cookbook, apachev2 or none
.
.TP
\fB\-e\fR, \fB\-\-email email\fR
email address of cookbook maintainer
.
.P
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\.
.
.IP "\(bu" 4
cookbook/attributes
.
.IP "\(bu" 4
cookbook/definitions
.
.IP "\(bu" 4
cookbook/files/default
.
.IP "\(bu" 4
cookbook/libraries
.
.IP "\(bu" 4
cookbook/metadata\.rb
.
.IP "\(bu" 4
cookbook/providers
.
.IP "\(bu" 4
cookbook/readme\.md
.
.IP "\(bu" 4
cookbook/recipes/default\.rb
.
.IP "\(bu" 4
cookbook/resources
.
.IP "\(bu" 4
cookbook/templates/default
.
.IP "" 0
.
.P
supported readme formats are \'md\' (default), \'mkd\', \'txt\', \'rdoc\'\. the readme file will be written with the specified extension and a set of helpful starting headers\.
.
.P
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\.
.
.P
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\.
.
.P
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\.
.
.P
the cookbook copyright, license, email and readme_format settings can be filled in the \fBknife\.rb\fR, for example with default values:
.
.IP "" 4
.
.nf

cookbook_copyright "your_company_name"
cookbook_license "none"
cookbook_email "your_email"
readme_format "md"
.
.fi
.
.IP "" 0
.
.SH "METADATA"
\fBknife cookbook metadata cookbook\fR \fI(options)\fR
.
.TP
\fB\-a\fR, \fB\-\-all\fR
generate metadata for all cookbooks, rather than just a single cookbook
.
.TP
\fB\-o\fR, \fB\-\-cookbook\-path path:path\fR
a colon\-separated path to look for cookbooks in
.
.P
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\.
.
.SH "METADATA FROM FILE"
\fBknife cookbook metadata from file\fR \fI(options)\fR
.
.P
load the cookbook metadata from a specified file\.
.
.SH "TEST"
\fBknife cookbook test [cookbooks\.\.\.]\fR \fI(options)\fR
.
.TP
\fB\-a\fR, \fB\-\-all\fR
test all cookbooks, rather than just a single cookbook
.
.TP
\fB\-o\fR, \fB\-\-cookbook\-path path:path\fR
a colon\-separated path to look for cookbooks in
.
.P
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)\.
.
.SH "RECIPE LIST"
\fBknife recipe list [PATTERN]\fR
.
.P
List available recipes from the server\. Specify \fIPATTERN\fR as a regular expression to limit the results\.
.
.SH "DESCRIPTION"
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\.
.
.P
On disk, cookbooks are directories with a defined structure\. The following directories may appear within a cookbook:
.
.TP
COOKBOOK/attributes/
Ruby files that define default parameters to be used in recipes
.
.TP
COOKBOOK/definitions/
Ruby files that contain \fIresource definitions\fR
.
.TP
COOKBOOK/files/SPECIFICITY
Files of arbitrary type\. These files may be downloaded by chef\-client(8) when configuring a host\.
.
.TP
COOKBOOK/libraries/
Ruby files that contain library code needed for recipes
.
.TP
COOKBOOK/providers/
Ruby files that contain Lightweight Provider definitions
.
.TP
COOKBOOK/recipes/
Ruby files that use Chef\'s recipe DSL to describe the desired configuration of a system
.
.TP
COOKBOOK/resources/
Ruby files that contain Lightweight Resource definitions
.
.TP
COOKBOOK/templates/SPECIFICITY
ERuby (ERb) template files\. These are referenced by \fIrecipes\fR and evaluated to dynamically generate configuration files\.
.
.P
\fBSPECIFICITY\fR is a feature of \fIfiles\fR and \fItemplates\fR that allow you to specify alternate files to be used on a specific OS platform or host\. The default specificity setting is \fIdefault\fR, that is files in \fBCOOKBOOK/files/default\fR will be used when a more specific copy is not available\. Further documentation for this feature is available on the Chef wiki: \fIhttp://wiki\.opscode\.com/display/chef/File+Distribution#FileDistribution\-FileSpecificity\fR
.
.P
Cookbooks also contain a metadata file that defines various properties of the cookbook\. The most important of these are the \fIversion\fR and the \fIdependencies\fR\. The \fIversion\fR is used in combination with environments to select which copy of a given cookbook is distributed to a node\. The \fIdependencies\fR are used by the server to determine which additional cookbooks must be distributed to a given host when it requires a cookbook\.
.
.SH "SEE ALSO"
\fBknife\-environment(1)\fR \fBknife\-cookbook\-site(1)\fR \fIhttp://wiki\.opscode\.com/display/chef/Cookbooks\fR \fIhttp://wiki\.opscode\.com/display/chef/Metadata\fR
.
.SH "AUTHOR"
Chef was written by Adam Jacob \fIadam@opscode\.com\fR with many contributions from the community\.
.
.SH "DOCUMENTATION"
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\.
.
.SH "CHEF"
Knife is distributed with Chef\. \fIhttp://wiki\.opscode\.com/display/chef/Home\fR