summaryrefslogtreecommitdiff
path: root/distro/common/man/man1/knife-cookbook.1
blob: b42338c905678d4bcbc4f256ef4ea4a9c52530dd (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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
.\" Man page generated from reStructuredText.
.
.TH "KNIFE-COOKBOOK" "1" "Chef 11.16" "" "knife cookbook"
.SH NAME
knife-cookbook \- The man page for the knife cookbook subcommand.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
A cookbook is the fundamental unit of configuration and policy distribution. Each cookbook defines a scenario, such as everything needed to install and configure MySQL, and then it contains all of the components that are required to support that scenario, including:
.INDENT 0.0
.IP \(bu 2
Attribute values that are set on nodes
.IP \(bu 2
Definitions that allow the creation of reusable collections of resources
.IP \(bu 2
File distributions
.IP \(bu 2
Libraries that extend the chef\-client and/or provide helpers to Ruby code
.IP \(bu 2
Recipes that specify which resources to manage and the order in which those resources will be applied
.IP \(bu 2
Custom resources and providers
.IP \(bu 2
Templates
.IP \(bu 2
Versions
.IP \(bu 2
Metadata about recipes (including dependencies), version constraints, supported platforms, and so on
.UNINDENT
.sp
The \fBknife cookbook\fP subcommand is used to interact with cookbooks that are located on the Chef server or the local chef\-repo\&.
.SH COMMON OPTIONS
.sp
The following options may be used with any of the arguments available to the \fBknife cookbook\fP subcommand:
.INDENT 0.0
.TP
.B \fB\-\-chef\-zero\-port PORT\fP
The port on which chef\-zero will listen.
.TP
.B \fB\-c CONFIG_FILE\fP, \fB\-\-config CONFIG_FILE\fP
The configuration file to use.
.TP
.B \fB\-d\fP, \fB\-\-disable\-editing\fP
Use to prevent the $EDITOR from being opened and to accept data as\-is.
.TP
.B \fB\-\-defaults\fP
Use to have knife use the default value instead of asking a user to provide one.
.TP
.B \fB\-e EDITOR\fP, \fB\-\-editor EDITOR\fP
The $EDITOR that is used for all interactive commands.
.TP
.B \fB\-E ENVIRONMENT\fP, \fB\-\-environment ENVIRONMENT\fP
The name of the environment. When this option is added to a command, the command will run only against the named environment.
.TP
.B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP
The output format: \fBsummary\fP (default), \fBtext\fP, \fBjson\fP, \fByaml\fP, and \fBpp\fP\&.
.TP
.B \fB\-h\fP, \fB\-\-help\fP
Shows help for the command.
.TP
.B \fB\-k KEY\fP, \fB\-\-key KEY\fP
The private key that knife will use to sign requests made by the API client to the Chef server\&.
.TP
.B \fB\-\-[no\-]color\fP
Use to view colored output.
.TP
.B \fB\-\-print\-after\fP
Use to show data after a destructive operation.
.TP
.B \fB\-s URL\fP, \fB\-\-server\-url URL\fP
The URL for the Chef server\&.
.TP
.B \fB\-u USER\fP, \fB\-\-user USER\fP
The user name used by knife to sign requests made by the API client to the Chef server\&. Authentication will fail if the user name does not match the private key.
.TP
.B \fB\-V\fP, \fB\-\-verbose\fP
Set for more verbose outputs. Use \fB\-VV\fP for maximum verbosity.
.TP
.B \fB\-v\fP, \fB\-\-version\fP
The version of the chef\-client\&.
.TP
.B \fB\-y\fP, \fB\-\-yes\fP
Use to respond to all confirmation prompts with "Yes". knife will not ask for confirmation.
.TP
.B \fB\-z\fP, \fB\-\-local\-mode\fP
Use to run the chef\-client in local mode. This allows all commands that work against the Chef server to also work against the local chef\-repo\&.
.UNINDENT
.SH BULK DELETE
.sp
The \fBbulk delete\fP argument is used to delete cookbook files that match a pattern defined by a regular expression. The regular expression must be within quotes and not be surrounded by forward slashes (/).
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook bulk delete REGEX (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-p\fP, \fB\-\-purge\fP
Use to entirely remove a cookbook (or cookbook version) from the Chef server\&. This action should be used carefully because only one copy of any single file is stored on the Chef server\&. Consequently, purging a cookbook will disable any other cookbook that references one or more files from a cookbook that has been purged.
.UNINDENT
.sp
\fBExamples\fP
.sp
Use a regular expression to define the pattern used to bulk delete cookbooks:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook bulk delete "^[0\-9]{3}$" \-p
.ft P
.fi
.UNINDENT
.UNINDENT
.SH CREATE
.sp
The \fBcreate\fP argument is used to create a new cookbook directory on the local machine, including the following directories and files:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
cookbook/attributes
.IP \(bu 2
cookbook/CHANGELOG.md
.IP \(bu 2
cookbook/definitions
.IP \(bu 2
cookbook/files/default
.IP \(bu 2
cookbook/libraries
.IP \(bu 2
cookbook/metadata.rb
.IP \(bu 2
cookbook/providers
.IP \(bu 2
cookbook/README.md (or .rdoc)
.IP \(bu 2
cookbook/recipes/default.rb
.IP \(bu 2
cookbook/resources
.IP \(bu 2
cookbook/templates/default
.UNINDENT
.UNINDENT
.UNINDENT
.sp
After the cookbook is created, it can be uploaded to the Chef server using the \fBknife upload\fP argument.
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook create COOKBOOK_NAME (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-C COPYRIGHT_HOLDER\fP, \fB\-\-copyright COPYRIGHT_HOLDER\fP
The name of the copyright holder. This option will place a copyright notice that contains the name of the copyright holder in each of the pre\-created files. If this option is not specified, a copyright name of "your_company_name" will be used instead; it can be easily modified later.
.TP
.B \fB\-I LICENSE\fP, \fB\-\-license LICENSE\fP
The type of license under which a cookbook is distributed: \fBapachev2\fP, \fBgplv2\fP, \fBgplv3\fP, \fBmit\fP, or \fBnone\fP (default). This option will place the appropriate license notice in the pre\-created files: \fBApache v2.0\fP (for \fBapachev2\fP), \fBGPL v2\fP (for \fBgplv2\fP), \fBGPL v3\fP (for \fBgplv3\fP), \fBMIT\fP (for \fBmit\fP), or \fBlicense \(aqProprietary \- All Rights Reserved\fP (for \fBnone\fP). Be aware of the licenses for files inside of a cookbook and be sure to follow any restrictions they describe.
.TP
.B \fB\-m EMAIL\fP, \fB\-\-email EMAIL\fP
The email address for the individual who maintains the cookbook. This option will place an email address in each of the pre\-created files. If this option is not specified, an email name of "your_email" will be used instead; it can be easily modified later.
.TP
.B \fB\-o PATH\fP, \fB\-\-cookbook\-path PATH\fP
The directory in which cookbooks are created. This can be a colon\-separated path.
.TP
.B \fB\-r FORMAT\fP, \fB\-\-readme\-format FORMAT\fP
The document format of the readme file: \fBmd\fP (markdown) and \fBrdoc\fP (Ruby docs).
.UNINDENT
.sp
\fBExamples\fP
.sp
To create a cookbook named "my_cookbook" with copyright, email, license, and readme format options specified, enter:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook create my_cookbook \-C "My Name" \-m "my@email.com" \-I apachev2 \-r md
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
to return something like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
** Creating cookbook my_cookbook
** Creating README for cookbook: my_cookbook
** Creating metadata for cookbook: my_cookbook
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DELETE
.sp
The \fBdelete\fP argument is used to delete a specified cookbook or cookbook version on the Chef server (and not locally).
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook delete COOKBOOK_NAME [COOKBOOK_VERSION] (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-a\fP, \fB\-\-all\fP
Use to delete all cookbooks (and cookbook versions).
.TP
.B \fBCOOKBOOK_VERSION\fP
The version of a cookbook to be deleted. If a cookbook has only one version, this option does not need to be specified. If a cookbook has more than one version and this option is not specified, knife will prompt for a version.
.TP
.B \fB\-p\fP, \fB\-\-purge\fP
Use to entirely remove a cookbook (or cookbook version) from the Chef server\&. This action should be used carefully because only one copy of any single file is stored on the Chef server\&. Consequently, purging a cookbook will disable any other cookbook that references one or more files from a cookbook that has been purged.
.UNINDENT
.sp
\fBExamples\fP
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook delete cookbook_name version
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook delete smartmon 0.8
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Type \fBY\fP to confirm a deletion.
.SH DOWNLOAD
.sp
The \fBdownload\fP argument is used to download a cookbook from the Chef server to the current working directory.
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook download COOKBOOK_NAME [COOKBOOK_VERSION] (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-d DOWNLOAD_DIRECTORY\fP, \fB\-\-dir DOWNLOAD_DIRECTORY\fP
The directory in which cookbooks are located.
.TP
.B \fB\-f\fP, \fB\-\-force\fP
Use to overwrite an existing directory.
.TP
.B \fB\-N\fP, \fB\-\-latest\fP
Use to download the most recent version of a cookbook.
.UNINDENT
.sp
\fBExamples\fP
.sp
To download a cookbook named "smartmon", enter:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook download smartmon
.ft P
.fi
.UNINDENT
.UNINDENT
.SH LIST
.sp
The \fBlist\fP argument is used to view a list of cookbooks that are currently available on the Chef server\&. The list will contain only the most recent version for each cookbook by default.
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook list (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-a\fP, \fB\-\-all\fP
Use to return all available versions for every cookbook.
.TP
.B \fB\-w\fP, \fB\-\-with\-uri\fP
Use to show the corresponding URIs.
.UNINDENT
.sp
\fBExamples\fP
.sp
To view a list of cookbooks:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook list
.ft P
.fi
.UNINDENT
.UNINDENT
.SH METADATA
.sp
The \fBmetadata\fP argument is used to generate the metadata for one or more cookbooks.
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook metadata (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-a\fP, \fB\-\-all\fP
Use to generate metadata for all cookbooks.
.TP
.B \fB\-o PATH:PATH\fP, \fB\-\-cookbook\-path PATH:PATH\fP
The directory in which cookbooks are created. This can be a colon\-separated path.
.UNINDENT
.sp
\fBExamples\fP
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook metadata \-a
.ft P
.fi
.UNINDENT
.UNINDENT
.SH METADATA FROM FILE
.sp
The \fBmetadata from file\fP argument is used to load the metadata for a cookbook from a file.
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook metadata from file FILE
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This command does not have any specific options.
.sp
\fBExamples\fP
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook metadata from file /path/to/file
.ft P
.fi
.UNINDENT
.UNINDENT
.SH SHOW
.sp
The \fBshow\fP argument is used to view information about a cookbook, parts of a cookbook (attributes, definitions, files, libraries, providers, recipes, resources, and templates), or a file that is associated with a cookbook (including attributes such as checksum or specificity).
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook show COOKBOOK_NAME [COOKBOOK_VERSION] [PART...] [FILE_NAME] (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fBCOOKBOOK_VERSION\fP
The version of a cookbook to be shown. If a cookbook has only one version, this option does not need to be specified. If a cookbook has more than one version and this option is not specified, a list of cookbook versions will be returned.
.TP
.B \fB\-f FQDN\fP, \fB\-\-fqdn FQDN\fP
The FQDN of the host.
.TP
.B \fBFILE_NAME\fP
The name of a file that is associated with a cookbook.
.TP
.B \fB\-p PLATFORM\fP, \fB\-\-platform PLATFORM\fP
The platform for which a cookbook is designed.
.TP
.B \fBPART\fP
The part of the cookbook to show: \fBattributes\fP, \fBdefinitions\fP, \fBfiles\fP, \fBlibraries\fP, \fBproviders\fP, \fBrecipes\fP, \fBresources\fP, or \fBtemplates\fP\&. More than one part can be specified.
.TP
.B \fB\-V PLATFORM_VERSION\fP, \fB\-\-platform\-version PLATFORM_VERSION\fP
The version of the platform.
.TP
.B \fB\-w\fP, \fB\-\-with\-uri\fP
Use to show the corresponding URIs.
.UNINDENT
.sp
\fBExamples\fP
.sp
To get the list of available versions of a cookbook named "getting\-started", enter:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook show getting\-started
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
to return something like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
getting\-started   0.3.0  0.2.0
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To show a list of data about a cookbook using the name of the cookbook and the version, enter:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook show getting\-started 0.3.0
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
to return something like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
attributes:
  checksum:     fa0fc4abf3f6787aeb5c3c5c35de667c
  name:         default.rb
  path:         attributes/default.rb
  specificity:  default
  url:          https://somelongurlhere.com
chef_type:      cookbook_version
cookbook_name:  getting\-started
definitions:    []
files:          []
frozen?:        false
json_class:     Chef::CookbookVersion
libraries:      []
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To only view data about "templates", enter:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook show getting\-started 0.3.0 templates
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
to return something like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
checksum:     a29d6f254577b830091f140c3a78b1fe
name:         chef\-getting\-started.txt.erb
path:         templates/default/chef\-getting\-started.txt.erb
specificity:  default
url:          https://someurlhere.com
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To view information in JSON format, use the \fB\-F\fP common option as part of the command like this:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife role show devops \-F json
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Other formats available include \fBtext\fP, \fByaml\fP, and \fBpp\fP\&.
.SH TEST
.sp
The \fBtest\fP argument is used to test a cookbook for syntax errors. This argument uses Ruby syntax checking to verify every file in a cookbook that ends in .rb and Embedded Ruby (ERB)\&. This argument will respect \&.chefignore files when determining which cookbooks to test for syntax errors.
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook test COOKBOOK_NAME (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-a\fP, \fB\-\-all\fP
Use to test all cookbooks.
.TP
.B \fB\-o PATH:PATH\fP, \fB\-\-cookbook\-path PATH:PATH\fP
The directory in which cookbooks are created. This can be a colon\-separated path.
.UNINDENT
.sp
\fBExamples\fP
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook test cookbook_name
.ft P
.fi
.UNINDENT
.UNINDENT
.SH UPLOAD
.sp
The \fBupload\fP argument is used to upload one or more cookbooks (and any files that are associated with those cookbooks) from a local repository to the Chef server\&. Only files that do not already exist on the Chef server will be uploaded.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Use a \&.chefignore file to prevent the upload of specific files and file types, such as temporary files or files placed in folders by version control systems. The \&.chefignore file must be located in the root of the cookbook repository and must use rules similar to filename globbing (as defined by the Ruby \fBFile.fnmatch\fP syntax).
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Empty directories are not uploaded to the Chef server\&. To upload an empty directory, create a "dot" file\-\-\-e.g. \fB\&.keep\fP\-\-\-in that directory to ensure that the directory itself is not empty.
.UNINDENT
.UNINDENT
.sp
\fBSyntax\fP
.sp
This argument has the following syntax:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook upload [COOKBOOK_NAME...] (options)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBOptions\fP
.sp
This argument has the following options:
.INDENT 0.0
.TP
.B \fB\-a\fP, \fB\-\-all\fP
Use to upload all cookbooks.
.TP
.B \fB\-\-concurrency\fP
The number of allowed concurrent connections. Default: \fB10\fP\&.
.TP
.B \fB\-d\fP, \fB\-\-include\-dependencies\fP
Use to ensure that when a cookbook has a dependency on one (or more) cookbooks, those cookbooks will also be uploaded.
.TP
.B \fB\-E ENVIRONMENT\fP, \fB\-\-environment ENVIRONMENT\fP
Use to set the environment version dependency to the cookbook version being uploaded.
.TP
.B \fB\-\-force\fP
Use to update a cookbook even if the \fB\-\-freeze\fP flag has been set.
.TP
.B \fB\-\-freeze\fP
Use to require changes to a cookbook be included as a new version. Only the \fB\-\-force\fP option can override this setting.
.TP
.B \fB\-o PATH:PATH\fP, \fB\-\-cookbook\-path PATH:PATH\fP
The directory in which cookbooks are created. This can be a colon\-separated path.
.UNINDENT
.sp
\fBExamples\fP
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook upload cookbook_name
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
To upload a cookbook, and then prevent other users from being able to make changes to it, enter:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ knife cookbook upload redis \-\-freeze
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
to return something like:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Uploading redis...
Upload completed
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If a cookbook is frozen and the \fB\-\-force\fP option is not specified, knife will return an error message similar to the following:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Uploading redis...
ERROR: Version 0.1.6 of cookbook redis is frozen. Use \-\-force to override.
.ft P
.fi
.UNINDENT
.UNINDENT
.SH AUTHOR
Chef
.\" Generated by docutils manpage writer.
.