summaryrefslogtreecommitdiff
path: root/distro/common/html/knife_cookbook.html
blob: 28afbf0eed43d1622a7a7b55412a9e52af663b0b (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
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>knife cookbook &mdash; Knife Man Pages</title>
    
    <link rel="stylesheet" href="_static/chef.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/chef.ico"/>
    <link rel="top" title="Knife Man Pages" href="index.html" /> 
  </head>
  <body>
<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px">
<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li><a href="http://docs.opscode.com/chef/knife.html" target="_products">Knife</a>&#149;</li>
        <li><a href="http://docs.opscode.com/chef/resources.html" target="_products">Resources</a>&#149;</li>
        <li><a href="http://docs.opscode.com/chef/dsl_recipe.html" target="_products">Recipe DSL</a>&#149;</li>
        <li><a href="http://docs.opscode.com/chef/lwrps_custom.html" target="_products">LWRPs</a>&#149;</li>
        <li><a href="http://docs.opscode.com/search.html">Search the Docs</a>&#149;</li>
        <li><a href="http://docs.opscode.com/">Home</a> &raquo;</li>
 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="knife.html">
              <img class="logo" src="_static/chef_logo.png" alt="Logo"/>
            </a></p>
  <h3><a href="knife.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">knife cookbook</a><ul>
<li><a class="reference internal" href="#bulk-delete">bulk delete</a><ul>
<li><a class="reference internal" href="#syntax">Syntax</a></li>
<li><a class="reference internal" href="#options">Options</a><ul>
<li><a class="reference internal" href="#knife-rb-settings">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#examples">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#create">create</a><ul>
<li><a class="reference internal" href="#id1">Syntax</a></li>
<li><a class="reference internal" href="#id2">Options</a><ul>
<li><a class="reference internal" href="#id3">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id4">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#delete">delete</a><ul>
<li><a class="reference internal" href="#id5">Syntax</a></li>
<li><a class="reference internal" href="#id6">Options</a><ul>
<li><a class="reference internal" href="#id7">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id8">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#download">download</a><ul>
<li><a class="reference internal" href="#id9">Syntax</a></li>
<li><a class="reference internal" href="#id10">Options</a><ul>
<li><a class="reference internal" href="#id11">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id12">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#list">list</a><ul>
<li><a class="reference internal" href="#id13">Syntax</a></li>
<li><a class="reference internal" href="#id14">Options</a><ul>
<li><a class="reference internal" href="#id15">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id16">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#metadata">metadata</a><ul>
<li><a class="reference internal" href="#id17">Syntax</a></li>
<li><a class="reference internal" href="#id18">Options</a><ul>
<li><a class="reference internal" href="#id19">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id20">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#metadata-from-file">metadata from file</a><ul>
<li><a class="reference internal" href="#id21">Syntax</a></li>
<li><a class="reference internal" href="#id22">Options</a></li>
<li><a class="reference internal" href="#id23">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#show">show</a><ul>
<li><a class="reference internal" href="#id24">Syntax</a></li>
<li><a class="reference internal" href="#id25">Options</a><ul>
<li><a class="reference internal" href="#id26">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id27">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#test">test</a><ul>
<li><a class="reference internal" href="#id28">Syntax</a></li>
<li><a class="reference internal" href="#id29">Options</a><ul>
<li><a class="reference internal" href="#id30">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id31">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#upload">upload</a><ul>
<li><a class="reference internal" href="#id32">Syntax</a></li>
<li><a class="reference internal" href="#id33">Options</a><ul>
<li><a class="reference internal" href="#id34">knife.rb Settings</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id35">Examples</a></li>
</ul>
</li>
</ul>
</li>
</ul>

        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="knife-cookbook">
<h1>knife cookbook<a class="headerlink" href="#knife-cookbook" title="Permalink to this headline">¶</a></h1>
<p>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:</p>
<ul class="simple">
<li>Attribute values that are set on nodes</li>
<li>Definitions that allow the creation of reusable collections of resources</li>
<li>File distributions</li>
<li>Libraries that extend the chef-client and/or provide helpers to Ruby code</li>
<li>Recipes that specify which resources to manage and the order in which those resources will be applied</li>
<li>Custom resources and providers</li>
<li>Templates</li>
<li>Versions</li>
<li>Metadata about recipes (including dependencies), version constraints, supported platforms, and so on</li>
</ul>
<p>The <strong>knife cookbook</strong> subcommand is used to interact with cookbooks that are located on the server or the local chef-repo.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p>
</div>
<div class="section" id="bulk-delete">
<h2>bulk delete<a class="headerlink" href="#bulk-delete" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">bulk</span> <span class="pre">delete</span></tt> 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 (/).</p>
<div class="section" id="syntax">
<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook bulk delete REGEX <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="options">
<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-p</span></tt>, <tt class="docutils literal"><span class="pre">--purge</span></tt></dt>
<dd>Indicates that a cookbook (or cookbook version) will be removed entirely from the server. This action should be used carefully because only one copy of any single file is stored on the server. Consequently, purging a cookbook will disable any other cookbook that references one or more files from a cookbook that has been purged.</dd>
</dl>
<div class="section" id="knife-rb-settings">
<h4>knife.rb Settings<a class="headerlink" href="#knife-rb-settings" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">bulk</span> <span class="pre">delete</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:purge]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--purge</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:yes]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--yes</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="examples">
<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Bulk delete many cookbooks</strong></p>
<p>Use a regular expression to define the pattern used to bulk delete cookbooks:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook bulk delete <span class="s2">&quot;^[0-9]{3}$&quot;</span> -p
</pre></div>
</div>
</div>
</div>
<div class="section" id="create">
<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to create a new cookbook directory on the local machine, including the following directories and files:</p>
<blockquote>
<div><ul class="simple">
<li>cookbook/attributes</li>
<li>cookbook/CHANGELOG.md</li>
<li>cookbook/definitions</li>
<li>cookbook/files/default</li>
<li>cookbook/libraries</li>
<li>cookbook/metadata.rb</li>
<li>cookbook/providers</li>
<li>cookbook/README.md (or .rdoc)</li>
<li>cookbook/recipes/default.rb</li>
<li>cookbook/resources</li>
<li>cookbook/templates/default</li>
</ul>
</div></blockquote>
<p>After the cookbook is created, it can be uploaded to the server using the <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">upload</span></tt> argument.</p>
<div class="section" id="id1">
<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook create COOKBOOK_NAME <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-C</span> <span class="pre">COPYRIGHT_HOLDER</span></tt>, <tt class="docutils literal"><span class="pre">--copyright</span> <span class="pre">COPYRIGHT_HOLDER</span></tt></dt>
<dd>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 &#8220;your_company_name&#8221; will be used instead; it can be easily modified later.</dd>
<dt><tt class="docutils literal"><span class="pre">-I</span> <span class="pre">LICENSE</span></tt>, <tt class="docutils literal"><span class="pre">--license</span> <span class="pre">LICENSE</span></tt></dt>
<dd>The type of license under which a cookbook is distributed: <tt class="docutils literal"><span class="pre">apachev2</span></tt>, <tt class="docutils literal"><span class="pre">gplv2</span></tt>, <tt class="docutils literal"><span class="pre">gplv3</span></tt>, <tt class="docutils literal"><span class="pre">mit</span></tt>, or <tt class="docutils literal"><span class="pre">none</span></tt> (default). This option will place the appropriate license notice in the pre-created files: <tt class="docutils literal"><span class="pre">Apache</span> <span class="pre">v2.0</span></tt> (for <tt class="docutils literal"><span class="pre">apachev2</span></tt>), <tt class="docutils literal"><span class="pre">GPL</span> <span class="pre">v2</span></tt> (for <tt class="docutils literal"><span class="pre">gplv2</span></tt>), <tt class="docutils literal"><span class="pre">GPL</span> <span class="pre">v3</span></tt> (for <tt class="docutils literal"><span class="pre">gplv3</span></tt>), <tt class="docutils literal"><span class="pre">MIT</span></tt> (for <tt class="docutils literal"><span class="pre">mit</span></tt>), or <tt class="docutils literal"><span class="pre">license</span> <span class="pre">'Proprietary</span> <span class="pre">-</span> <span class="pre">All</span> <span class="pre">Rights</span> <span class="pre">Reserved</span></tt> (for <tt class="docutils literal"><span class="pre">none</span></tt>). Be aware of the licenses for files inside of a cookbook and be sure to follow any restrictions they describe.</dd>
<dt><tt class="docutils literal"><span class="pre">-m</span> <span class="pre">EMAIL</span></tt>, <tt class="docutils literal"><span class="pre">--email</span> <span class="pre">EMAIL</span></tt></dt>
<dd>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 &#8220;your_email&#8221; will be used instead; it can be easily modified later.</dd>
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH</span></tt></dt>
<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd>
<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">FORMAT</span></tt>, <tt class="docutils literal"><span class="pre">--readme-format</span> <span class="pre">FORMAT</span></tt></dt>
<dd>The document format of the readme file: <tt class="docutils literal"><span class="pre">md</span></tt> (markdown) and <tt class="docutils literal"><span class="pre">rdoc</span></tt> (Ruby docs).</dd>
</dl>
<div class="section" id="id3">
<h4>knife.rb Settings<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">create</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:readme_format]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--readme-format</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id4">
<h3>Examples<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Create a cookbook</strong></p>
<p>To create a cookbook named &#8220;my_cookbook&#8221; with copyright, email, license, and readme format options specified, enter:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook create my_cookbook -C <span class="s2">&quot;My Name&quot;</span> -m <span class="s2">&quot;my@email.com&quot;</span> -I apachev2 -r md
</pre></div>
</div>
<p>to return something like:</p>
<div class="highlight-bash"><div class="highlight"><pre>** Creating cookbook my_cookbook
** Creating README <span class="k">for </span>cookbook: my_cookbook
** Creating metadata <span class="k">for </span>cookbook: my_cookbook
</pre></div>
</div>
</div>
</div>
<div class="section" id="delete">
<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a specified cookbook or cookbook version on the server (and not locally).</p>
<div class="section" id="id5">
<h3>Syntax<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook delete COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id6">
<h3>Options<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt>
<dd>Indicates that a cookbook and every version of that cookbook will be deleted.</dd>
<dt><tt class="docutils literal"><span class="pre">COOKBOOK_VERSION</span></tt></dt>
<dd>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.</dd>
<dt><tt class="docutils literal"><span class="pre">-p</span></tt>, <tt class="docutils literal"><span class="pre">--purge</span></tt></dt>
<dd>Indicates that a cookbook (or cookbook version) will be removed entirely from the server. This action should be used carefully because only one copy of any single file is stored on the server. Consequently, purging a cookbook will disable any other cookbook that references one or more files from a cookbook that has been purged.</dd>
</dl>
<div class="section" id="id7">
<h4>knife.rb Settings<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">delete</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:all]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--all</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:print_after]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--print-after</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:purge]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--purge</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id8">
<h3>Examples<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Delete a cookbook</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook delete cookbook_name version
</pre></div>
</div>
<p>For example:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook delete smartmon 0.8
</pre></div>
</div>
<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p>
</div>
</div>
<div class="section" id="download">
<h2>download<a class="headerlink" href="#download" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">download</span></tt> argument is used to download a cookbook from the server to the current working directory.</p>
<div class="section" id="id9">
<h3>Syntax<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook download COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id10">
<h3>Options<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-d</span> <span class="pre">DOWNLOAD_DIRECTORY</span></tt>, <tt class="docutils literal"><span class="pre">--dir</span> <span class="pre">DOWNLOAD_DIRECTORY</span></tt></dt>
<dd>The directory into which a cookbook will be downloaded.</dd>
<dt><tt class="docutils literal"><span class="pre">-f</span></tt>, <tt class="docutils literal"><span class="pre">--force</span></tt></dt>
<dd>Indicates that an existing directory will be overwritten.</dd>
<dt><tt class="docutils literal"><span class="pre">-N</span></tt>, <tt class="docutils literal"><span class="pre">--latest</span></tt></dt>
<dd>Indicates that the most recent version of a cookbook will be downloaded.</dd>
</dl>
<div class="section" id="id11">
<h4>knife.rb Settings<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">download</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:download_directory]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--dir</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:force]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--force</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:latest]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--latest</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id12">
<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Download a cookbook</strong></p>
<p>To download a cookbook named &#8220;smartmon&#8221;, enter:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook download smartmon
</pre></div>
</div>
</div>
</div>
<div class="section" id="list">
<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view a list of cookbooks that are currently available on the server. The list will contain only the most recent version for each cookbook by default.</p>
<div class="section" id="id13">
<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook list <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id14">
<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt>
<dd>Indicates that all available versions of each cookbook will be returned.</dd>
<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt>
<dd>Indicates that the corresponding URIs will be shown.</dd>
</dl>
<div class="section" id="id15">
<h4>knife.rb Settings<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">list</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:all]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--all</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:environment]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--environment</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id16">
<h3>Examples<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>View a list of cookbooks</strong></p>
<p>To view a list of cookbooks:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook list
</pre></div>
</div>
</div>
</div>
<div class="section" id="metadata">
<h2>metadata<a class="headerlink" href="#metadata" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">metadata</span></tt> argument is used to generate the metadata for one or more cookbooks.</p>
<div class="section" id="id17">
<h3>Syntax<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadata <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id18">
<h3>Options<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt>
<dd>Indicates that metadata should be generated for all cookbooks, and not just for a specified cookbook.</dd>
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt>
<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd>
</dl>
<div class="section" id="id19">
<h4>knife.rb Settings<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">metadata</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:all]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--all</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id20">
<h3>Examples<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Generate metadata</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadata -a
</pre></div>
</div>
</div>
</div>
<div class="section" id="metadata-from-file">
<h2>metadata from file<a class="headerlink" href="#metadata-from-file" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">metadata</span> <span class="pre">from</span> <span class="pre">file</span></tt> argument is used to load the metadata for a cookbook from a file.</p>
<div class="section" id="id21">
<h3>Syntax<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadata from file FILE
</pre></div>
</div>
</div>
<div class="section" id="id22">
<h3>Options<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3>
<p>This command does not have any specific options.</p>
</div>
<div class="section" id="id23">
<h3>Examples<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>View metadata</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook metadta from file /path/to/file
</pre></div>
</div>
</div>
</div>
<div class="section" id="show">
<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">show</span></tt> 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).</p>
<div class="section" id="id24">
<h3>Syntax<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show COOKBOOK_NAME <span class="o">[</span>COOKBOOK_VERSION<span class="o">]</span> <span class="o">[</span>PART...<span class="o">]</span> <span class="o">[</span>FILE_NAME<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id25">
<h3>Options<a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">COOKBOOK_VERSION</span></tt></dt>
<dd>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.</dd>
<dt><tt class="docutils literal"><span class="pre">-f</span> <span class="pre">FQDN</span></tt>, <tt class="docutils literal"><span class="pre">--fqdn</span> <span class="pre">FQDN</span></tt></dt>
<dd>The FQDN of the host.</dd>
<dt><tt class="docutils literal"><span class="pre">FILE_NAME</span></tt></dt>
<dd>The name of a file that is associated with a cookbook.</dd>
<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PLATFORM</span></tt>, <tt class="docutils literal"><span class="pre">--platform</span> <span class="pre">PLATFORM</span></tt></dt>
<dd>The platform for which a cookbook is designed.</dd>
<dt><tt class="docutils literal"><span class="pre">PART</span></tt></dt>
<dd>The part of the cookbook to show: <tt class="docutils literal"><span class="pre">attributes</span></tt>, <tt class="docutils literal"><span class="pre">definitions</span></tt>, <tt class="docutils literal"><span class="pre">files</span></tt>, <tt class="docutils literal"><span class="pre">libraries</span></tt>, <tt class="docutils literal"><span class="pre">providers</span></tt>, <tt class="docutils literal"><span class="pre">recipes</span></tt>, <tt class="docutils literal"><span class="pre">resources</span></tt>, or <tt class="docutils literal"><span class="pre">templates</span></tt>. More than one part can be specified.</dd>
<dt><tt class="docutils literal"><span class="pre">-V</span> <span class="pre">PLATFORM_VERSION</span></tt>, <tt class="docutils literal"><span class="pre">--platform-version</span> <span class="pre">PLATFORM_VERSION</span></tt></dt>
<dd>The version of the platform.</dd>
<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt>
<dd>Indicates that the corresponding URIs will be shown.</dd>
</dl>
<div class="section" id="id26">
<h4>knife.rb Settings<a class="headerlink" href="#id26" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">show</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:fqdn]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--fqdn</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:platform]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--platform</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:platform_version]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--platform-version</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id27">
<h3>Examples<a class="headerlink" href="#id27" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Show cookbook data</strong></p>
<p>To get the list of available versions of a cookbook named &#8220;getting-started&#8221;, enter:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show getting-started
</pre></div>
</div>
<p>to return something like:</p>
<div class="highlight-bash"><div class="highlight"><pre>getting-started   0.3.0  0.2.0
</pre></div>
</div>
<p><strong>Show cookbook versions</strong></p>
<p>To show a list of data about a cookbook using the name of the cookbook and the version, enter:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show getting-started 0.3.0
</pre></div>
</div>
<p>to return something like:</p>
<div class="highlight-bash"><div class="highlight"><pre>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:    <span class="o">[]</span>
files:          <span class="o">[]</span>
frozen?:        <span class="nb">false</span>
json_class:     Chef::CookbookVersion
libraries:      <span class="o">[]</span>
</pre></div>
</div>
<p><strong>Show a cookbook version</strong></p>
<p>To only view data about &#8220;templates&#8221;, enter:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook show getting-started 0.3.0 templates
</pre></div>
</div>
<p>to return something like:</p>
<div class="highlight-bash"><div class="highlight"><pre>checksum:     a29d6f254577b830091f140c3a78b1fe
name:         chef-getting-started.txt.erb
path:         templates/default/chef-getting-started.txt.erb
specificity:  default
url:          https://someurlhere.com
</pre></div>
</div>
<p><strong>Show cookbook data as JSON</strong></p>
<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json
</pre></div>
</div>
<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p>
</div>
</div>
<div class="section" id="test">
<h2>test<a class="headerlink" href="#test" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">test</span></tt> 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).</p>
<div class="section" id="id28">
<h3>Syntax<a class="headerlink" href="#id28" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook <span class="nb">test </span>COOKBOOK_NAME <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id29">
<h3>Options<a class="headerlink" href="#id29" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt>
<dd>Indicates that all cookbooks will be tested.</dd>
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt>
<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd>
</dl>
<div class="section" id="id30">
<h4>knife.rb Settings<a class="headerlink" href="#id30" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">test</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:all]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--all</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id31">
<h3>Examples<a class="headerlink" href="#id31" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Test a cookbook</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook <span class="nb">test </span>cookbook_name
</pre></div>
</div>
</div>
</div>
<div class="section" id="upload">
<h2>upload<a class="headerlink" href="#upload" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">upload</span></tt> argument is used to upload one or more cookbooks (and any files that are associated with those cookbooks) from a local repository to the server. Only files that do not already exist on the server will be uploaded.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">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 <tt class="docutils literal"><span class="pre">File.fnmatch</span></tt> syntax).</p>
</div>
<div class="section" id="id32">
<h3>Syntax<a class="headerlink" href="#id32" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following syntax:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook upload <span class="o">[</span>COOKBOOK_NAME...<span class="o">]</span> <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
</div>
<div class="section" id="id33">
<h3>Options<a class="headerlink" href="#id33" title="Permalink to this headline">¶</a></h3>
<p>This argument has the following options:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt>
<dd>Indicates that all cookbooks will be uploaded.</dd>
<dt><tt class="docutils literal"><span class="pre">-d</span></tt>, <tt class="docutils literal"><span class="pre">--include-dependencies</span></tt></dt>
<dd>Indicates that when a cookbook has a dependency on one (or more) cookbooks, those cookbooks will also be uploaded.</dd>
<dt><tt class="docutils literal"><span class="pre">--force</span></tt></dt>
<dd>Indicates that a cookbook should be updated even if the <tt class="docutils literal"><span class="pre">--freeze</span></tt> flag has been set.</dd>
<dt><tt class="docutils literal"><span class="pre">--freeze</span></tt></dt>
<dd>Indicates that a cookbook cannot be modified; any changes to this cookbook must be included as a new version. Only the <tt class="docutils literal"><span class="pre">--force</span></tt> option can override this setting.</dd>
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt>
<dd>The directory in which cookbook are created. This can be a colon-separated path.</dd>
</dl>
<div class="section" id="id34">
<h4>knife.rb Settings<a class="headerlink" href="#id34" title="Permalink to this headline">¶</a></h4>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p>
</div>
<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">cookbook</span> <span class="pre">upload</span></tt> settings can be added to the knife.rb file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">knife[:all]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--all</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:depends]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--include-dependencies</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:environment]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--environment</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:force]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--force</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">knife[:freeze]</span></tt></dt>
<dd>Use to add the <tt class="docutils literal"><span class="pre">--freeze</span></tt> option.</dd>
</dl>
</div>
</div>
<div class="section" id="id35">
<h3>Examples<a class="headerlink" href="#id35" title="Permalink to this headline">¶</a></h3>
<p>The following examples show how to use this Knife subcommand:</p>
<p><strong>Upload a cookbook</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook upload cookbook_name
</pre></div>
</div>
<p><strong>Freeze a cookbook</strong></p>
<p>To upload a cookbook, and then prevent other users from being able to make changes to it, enter:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife cookbook upload redis --freeze
</pre></div>
</div>
<p>to return something like:</p>
<div class="highlight-bash"><div class="highlight"><pre>Uploading redis...
Upload completed
</pre></div>
</div>
<p>If a cookbook is frozen and the <tt class="docutils literal"><span class="pre">--force</span></tt> option is not specified, Knife will return an error message similar to the following:</p>
<div class="highlight-bash"><div class="highlight"><pre>Uploading redis...
ERROR: Version 0.1.6 of cookbook redis is frozen. Use --force to override.
</pre></div>
</div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li><a href="http://docs.opscode.com/chef/knife.html" target="_products">Knife</a>&#149;</li>
        <li><a href="http://docs.opscode.com/chef/resources.html" target="_products">Resources</a>&#149;</li>
        <li><a href="http://docs.opscode.com/chef/dsl_recipe.html" target="_products">Recipe DSL</a>&#149;</li>
        <li><a href="http://docs.opscode.com/chef/lwrps_custom.html" target="_products">LWRPs</a>&#149;</li>
        <li><a href="http://docs.opscode.com/search.html">Search the Docs</a>&#149;</li>
        <li><a href="http://docs.opscode.com/">Home</a> &raquo;</li>
 
      </ul>
    </div>


    <div class="footer">
      Documentation for current man pages for Knife.

    &nbsp;Send feedback to <a href="mailto:docs@getchef.com">docs@getchef.com</a>.
       This work is licensed under a Creative Commons Attribution 3.0 Unported License. 

    </div>

<!-- Start of Async Google Analytics Code -->
<script type="text/javascript">
var _gaq = _gaq || [];
var pluginUrl = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.') + 'google-analytics.com/plugins/ga/inpage_linkid.js';
_gaq.push(['_setAccount', 'UA-6369228-7']);
_gaq.push(['_setDomainName', '.opscode.com']);
_gaq.push(['_setAllowHash', false]);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_addIgnoredRef','opscode.com']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript';
  ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(ga, s); })();
</script>
<!-- End of Async Google Analytics Code -->



<!-- Start of Contact Analytics Code -->
<script type="text/javascript">
(function() {
  var didInit = false;
  function initMunchkin() {
    if(didInit === false) {
      didInit = true;
      Munchkin.init('255-VFB-268');
    }
  }
  var s = document.createElement('script');
  s.type = 'text/javascript';
  s.async = true;
  s.src = document.location.protocol + '//munchkin.marketo.net/munchkin.js';
  s.onreadystatechange = function() {
    if (this.readyState == 'complete' || this.readyState == 'loaded') {
      initMunchkin();
    }
  };
  s.onload = initMunchkin;
  document.getElementsByTagName('head')[0].appendChild(s);
})();
</script>
<!-- End of Contact Analytics Code -->


  </body>
</html>