chef 0.10.0.beta.8 → 0.10.0.beta.9
Sign up to get free protection for your applications and to get access to all the features.
- data/distro/common/html/knife-bootstrap.1.html +69 -10
- data/distro/common/html/knife-client.1.html +25 -22
- data/distro/common/html/knife-configure.1.html +1 -1
- data/distro/common/html/knife-cookbook-site.1.html +91 -19
- data/distro/common/html/knife-cookbook.1.html +216 -76
- data/distro/common/html/knife-data-bag.1.html +1 -1
- data/distro/common/html/knife-environment.1.html +177 -3
- data/distro/common/html/knife-exec.1.html +44 -3
- data/distro/common/html/knife-index.1.html +1 -1
- data/distro/common/html/knife-node.1.html +5 -3
- data/distro/common/html/knife-recipe.1.html +1 -1
- data/distro/common/html/knife-role.1.html +83 -19
- data/distro/common/html/knife-search.1.html +43 -2
- data/distro/common/html/knife-ssh.1.html +57 -2
- data/distro/common/html/knife-status.1.html +33 -2
- data/distro/common/html/knife-tag.1.html +45 -1
- data/distro/common/html/knife.1.html +94 -161
- data/distro/common/html/shef.1.html +283 -0
- data/distro/common/man/man1/knife-bootstrap.1 +56 -4
- data/distro/common/man/man1/knife-client.1 +12 -11
- data/distro/common/man/man1/knife-configure.1 +1 -1
- data/distro/common/man/man1/knife-cookbook-site.1 +64 -22
- data/distro/common/man/man1/knife-cookbook.1 +200 -122
- data/distro/common/man/man1/knife-data-bag.1 +1 -1
- data/distro/common/man/man1/knife-environment.1 +167 -2
- data/distro/common/man/man1/knife-exec.1 +36 -3
- data/distro/common/man/man1/knife-index.1 +1 -1
- data/distro/common/man/man1/knife-node.1 +2 -1
- data/distro/common/man/man1/knife-role.1 +48 -24
- data/distro/common/man/man1/knife-search.1 +27 -3
- data/distro/common/man/man1/knife-ssh.1 +43 -2
- data/distro/common/man/man1/knife-status.1 +14 -2
- data/distro/common/man/man1/knife-tag.1 +32 -2
- data/distro/common/man/man1/knife.1 +91 -186
- data/distro/common/man/man1/shef.1 +237 -26
- data/distro/common/markdown/man1/knife-bootstrap.mkd +57 -7
- data/distro/common/markdown/man1/knife-client.mkd +19 -17
- data/distro/common/markdown/man1/knife-cookbook-site.mkd +63 -15
- data/distro/common/markdown/man1/knife-cookbook.mkd +220 -103
- data/distro/common/markdown/man1/knife-environment.mkd +144 -1
- data/distro/common/markdown/man1/knife-exec.mkd +29 -1
- data/distro/common/markdown/man1/knife-node.mkd +1 -1
- data/distro/common/markdown/man1/knife-role.mkd +36 -30
- data/distro/common/markdown/man1/knife-search.mkd +0 -1
- data/distro/common/markdown/man1/knife-ssh.mkd +0 -2
- data/distro/common/markdown/man1/knife-status.mkd +0 -2
- data/distro/common/markdown/man1/knife-tag.mkd +31 -0
- data/distro/common/markdown/man1/knife.mkd +93 -165
- data/distro/common/markdown/man1/shef.mkd +189 -0
- data/lib/chef/api_client.rb +36 -35
- data/lib/chef/application/knife.rb +1 -1
- data/lib/chef/client.rb +1 -0
- data/lib/chef/cookbook/cookbook_version_loader.rb +29 -7
- data/lib/chef/cookbook_uploader.rb +55 -36
- data/lib/chef/cookbook_version.rb +3 -1
- data/lib/chef/couchdb.rb +0 -1
- data/lib/chef/knife/cookbook_list.rb +1 -1
- data/lib/chef/knife/cookbook_show.rb +1 -0
- data/lib/chef/knife/core/generic_presenter.rb +3 -3
- data/lib/chef/knife/help.rb +6 -2
- data/lib/chef/knife/tag_create.rb +26 -5
- data/lib/chef/knife/tag_delete.rb +34 -5
- data/lib/chef/knife/tag_list.rb +24 -6
- data/lib/chef/node.rb +1 -0
- data/lib/chef/role.rb +1 -0
- data/lib/chef/shef.rb +1 -0
- data/lib/chef/version.rb +1 -1
- metadata +4 -4
- data/distro/common/man/man1/knife-recipe.1 +0 -13
- data/distro/common/markdown/man1/knife-recipe.mkd +0 -24
@@ -28,12 +28,13 @@ __knife__ __bootstrap__ _(options)_
|
|
28
28
|
* `-d`, `--distro DISTRO`:
|
29
29
|
Bootstrap a distro using a template
|
30
30
|
|
31
|
+
## DESCRIPTION
|
32
|
+
|
31
33
|
Performs a Chef Bootstrap on the target node. The goal of the bootstrap
|
32
34
|
is to get Chef installed on the target system so it can run Chef Client
|
33
35
|
with a Chef Server. The main assumption is a baseline OS installation
|
34
36
|
exists. This sub-command is used internally by some cloud computing
|
35
|
-
|
36
|
-
version of Chef.
|
37
|
+
plugins.
|
37
38
|
|
38
39
|
The bootstrap sub-command supports supplying a template to perform the
|
39
40
|
bootstrap steps. If the distro is not specified (via `-d` or `--distro`
|
@@ -47,22 +48,34 @@ sub-command looks in the following locations for the template to use:
|
|
47
48
|
* `bootstrap` directory in the `$PWD/.chef`.
|
48
49
|
* `bootstrap` directory in the users `$HOME/.chef`.
|
49
50
|
|
50
|
-
The default bootstrap templates are scripts that get copied to the
|
51
|
+
The default bootstrap templates are scripts that get copied to the
|
52
|
+
target node (FQDN). The following distros are supported:
|
51
53
|
|
52
54
|
* centos5-gems
|
53
55
|
* fedora13-gems
|
54
56
|
* ubuntu10.04-gems
|
55
57
|
* ubuntu10.04-apt
|
56
58
|
|
57
|
-
The gems installations will use RubyGems 1.3.6 and Chef installed as a
|
59
|
+
The gems installations will use RubyGems 1.3.6 and Chef installed as a
|
60
|
+
gem. The apt installation will use the Opscode APT repository. The
|
61
|
+
RubyGems installation requires installing gems with native extensions,
|
62
|
+
so development related packages (ruby-dev, build-essential) are
|
63
|
+
installed. These are not installed with the apt installation, as native
|
64
|
+
extensions are already compiled in the required packages.
|
58
65
|
|
59
|
-
In addition to handling the software installation, these bootstrap
|
66
|
+
In addition to handling the software installation, these bootstrap
|
67
|
+
templates do the following:
|
60
68
|
|
61
69
|
- Write the validation.pem per the local knife configuration.
|
62
70
|
- Write a default config file for Chef (`/etc/chef/client.rb`) using values from the `knife.rb`.
|
63
71
|
- Create a JSON attributes file containing the specified run list and run Chef.
|
64
72
|
|
65
|
-
In the case of the RubyGems, the `client.rb` will be written from
|
73
|
+
In the case of the RubyGems, the `client.rb` will be written from
|
74
|
+
scratch with a minimal set of values; see __EXAMPLES__. In the case of
|
75
|
+
APT Package installation, `client.rb` will have the
|
76
|
+
`validation_client_name` appended if it is not set to `chef-validator`
|
77
|
+
(default config value), and the `node_name` will be added if
|
78
|
+
`chef_node_name` option is specified.
|
66
79
|
|
67
80
|
When this is complete, the bootstrapped node will have:
|
68
81
|
|
@@ -70,8 +83,45 @@ When this is complete, the bootstrapped node will have:
|
|
70
83
|
- Be validated with the configured Chef Server.
|
71
84
|
- Have run Chef with its default run list if one is specfied.
|
72
85
|
|
73
|
-
Additional custom bootstrap templates can be created and stored in
|
86
|
+
Additional custom bootstrap templates can be created and stored in
|
87
|
+
`.chef/bootstrap/DISTRO.erb`, replacing __DISTRO__ with the value passed
|
88
|
+
with the `-d` or `--distro` option. See __EXAMPLES__ for more
|
89
|
+
information.
|
90
|
+
|
91
|
+
## EXAMPLES
|
92
|
+
Setting up a custom bootstrap is fairly straightforward. Create a
|
93
|
+
`.chef/bootstrap` directory in your Chef Repository or in
|
94
|
+
`$HOME/.chef/bootstrap`. Then create the ERB template file.
|
95
|
+
|
96
|
+
mkdir ~/.chef/bootstrap
|
97
|
+
vi ~/.chef/bootstrap/debian5.0-apt.erb
|
98
|
+
|
99
|
+
For example, to create a new bootstrap template that should be used when
|
100
|
+
setting up a new Debian node. Edit the template to run the commands, set
|
101
|
+
up the validation certificate and the client configuration file, and
|
102
|
+
finally to run chef-client on completion. The bootstrap template can be
|
103
|
+
called with:
|
104
|
+
|
105
|
+
knife bootstrap mynode.example.com --template-file ~/.chef/bootstrap/debian5.0-apt.erb
|
106
|
+
|
107
|
+
Or,
|
108
|
+
|
109
|
+
knife bootstrap mynode.example.com --distro debian5.0-apt
|
110
|
+
|
111
|
+
The `--distro` parameter will automatically look in the
|
112
|
+
`~/.chef/bootstrap` directory for a file named `debian5.0-apt.erb`.
|
113
|
+
|
114
|
+
Templates provided by the Chef installation are located in
|
115
|
+
`BASEDIR/lib/chef/knife/bootstrap/*.erb`, where _BASEDIR_ is the
|
116
|
+
location where the package or Gem installed the Chef client libraries.
|
117
|
+
|
118
|
+
## BUGS
|
119
|
+
`knife bootstrap` is not capable of bootstrapping multiple hosts in
|
120
|
+
parallel.
|
74
121
|
|
122
|
+
The bootstrap script is passed as an argument to sh(1) on the remote
|
123
|
+
system, so sensitive information contained in the script will be visible
|
124
|
+
to other users via the process list using tools such as ps(1).
|
75
125
|
|
76
126
|
## SEE ALSO
|
77
127
|
__knife-ssh__(1)
|
@@ -5,23 +5,9 @@ knife-client(1) -- Manage Chef API Clients
|
|
5
5
|
|
6
6
|
__knife__ __client__ _sub-command_ _(options)_
|
7
7
|
|
8
|
-
##
|
9
|
-
|
10
|
-
|
11
|
-
clients only communicate with the Chef Server API and are authenticated
|
12
|
-
via request signatures.
|
13
|
-
|
14
|
-
In the typical case, there will be one client object on the server for
|
15
|
-
each node, and the corresponding client and node will have identical
|
16
|
-
names.
|
17
|
-
|
18
|
-
In the Chef authorization model, there is one special client, the
|
19
|
-
"validator", which is authorized to create new non-administrative
|
20
|
-
clients but has minimal privileges otherwise. This identity is used as a
|
21
|
-
sort of "guest account" to create a client identity when initially
|
22
|
-
setting up a host for management with Chef.
|
23
|
-
|
24
|
-
## CLIENT SUB-COMMANDS
|
8
|
+
## SUB-COMMANDS
|
9
|
+
Client subcommands follow a basic create, read, update, delete (CRUD)
|
10
|
+
pattern. The Following subcommands are available:
|
25
11
|
|
26
12
|
## BULK DELETE
|
27
13
|
__knife client bulk delete__ _regex_ _(options)_
|
@@ -86,6 +72,22 @@ __client show__ _client name_ _(options)_
|
|
86
72
|
|
87
73
|
Show a client. Output format is determined by the --format option.
|
88
74
|
|
75
|
+
## DESCRIPTION
|
76
|
+
Clients are identities used for communication with the Chef Server API,
|
77
|
+
roughly equivalent to user accounts on the Chef Server, except that
|
78
|
+
clients only communicate with the Chef Server API and are authenticated
|
79
|
+
via request signatures.
|
80
|
+
|
81
|
+
In the typical case, there will be one client object on the server for
|
82
|
+
each node, and the corresponding client and node will have identical
|
83
|
+
names.
|
84
|
+
|
85
|
+
In the Chef authorization model, there is one special client, the
|
86
|
+
"validator", which is authorized to create new non-administrative
|
87
|
+
clients but has minimal privileges otherwise. This identity is used as a
|
88
|
+
sort of "guest account" to create a client identity when initially
|
89
|
+
setting up a host for management with Chef.
|
90
|
+
|
89
91
|
## SEE ALSO
|
90
92
|
__knife-node__(1)
|
91
93
|
|
@@ -6,28 +6,58 @@ knife-cookbook-site(1) -- Install and update open source cookbooks
|
|
6
6
|
__knife__ __cookbook site__ _sub-command_ _(options)_
|
7
7
|
|
8
8
|
## COOKBOOK SITE SUB-COMMANDS
|
9
|
+
`knife cookbook site` provides the following subcommands:
|
9
10
|
|
10
|
-
|
11
|
+
## INSTALL
|
12
|
+
__cookbook site install COOKBOOK [VERSION]__ _(options)_
|
11
13
|
|
12
|
-
|
14
|
+
* `-d`, `--dependencies`:
|
15
|
+
Grab dependencies automatically
|
16
|
+
|
17
|
+
Uses git(1) version control in conjunction with the cookbook site to
|
18
|
+
install community contributed cookbooks to your local cookbook
|
19
|
+
repository. Running `knife cookbook site install` does the following:
|
20
|
+
|
21
|
+
1. A new "pristine copy" branch is created in git for tracking the
|
22
|
+
upstream;
|
23
|
+
2. All existing cookbooks are removed from the branch;
|
24
|
+
3. The cookbook is downloaded from the cookbook site in tarball form;
|
25
|
+
4. The downloaded cookbook is untarred, and its contents commited via git;
|
26
|
+
5. The pristine copy branch is merged into the master branch.
|
27
|
+
|
28
|
+
By installing cookbook with this process, you can locally modify the
|
29
|
+
upstream cookbook in your master branch ant let git maintain your
|
30
|
+
changes as a separate patch. When an updated upstream version becomes
|
31
|
+
available, you will be able to merge the upstream changes while
|
32
|
+
maintaining your local modifications.
|
33
|
+
|
34
|
+
If _-d_ is specified, the process is applied recursively to all the
|
35
|
+
cookbooks _COOKBOOK_ depends on (via metadata _dependencies_).
|
36
|
+
|
37
|
+
## DOWNLOAD
|
38
|
+
__knife cookbook site download COOKBOOK [VERSION]__ _(options)_
|
13
39
|
|
14
40
|
* `-f`, `--file FILE`:
|
15
41
|
The filename to write to
|
16
42
|
|
17
|
-
Downloads a specific cookbook from the Community site, optionally
|
43
|
+
Downloads a specific cookbook from the Community site, optionally
|
44
|
+
specifying a certain version.
|
18
45
|
|
19
|
-
|
46
|
+
## LIST
|
47
|
+
__knife cookbook site list__ _(options)_
|
20
48
|
|
21
49
|
* `-w`, `--with-uri`:
|
22
50
|
Show corresponding URIs
|
23
51
|
|
24
52
|
Lists available cookbooks from the Community site.
|
25
53
|
|
26
|
-
|
54
|
+
## SEARCH
|
55
|
+
__knife cookbook site search QUERY__ _(options)_
|
27
56
|
|
28
|
-
Searches
|
57
|
+
Searches for available cookbooks matching the specified query.
|
29
58
|
|
30
|
-
|
59
|
+
## SHARE
|
60
|
+
__knife cookbook site share COOKBOOK CATEGORY__ _(options)_
|
31
61
|
|
32
62
|
* `-k`, `--key KEY`:
|
33
63
|
API Client Key
|
@@ -36,26 +66,44 @@ __cookbook site share COOKBOOK CATEGORY__ _(options)_
|
|
36
66
|
* `-o`, `--cookbook-path PATH:PATH`:
|
37
67
|
A colon-separated path to look for cookbooks in
|
38
68
|
|
39
|
-
Uploads the specified cookbook using the given category to the Opscode
|
69
|
+
Uploads the specified cookbook using the given category to the Opscode
|
70
|
+
cookbooks site. Requires a login user and certificate for the Opscode
|
71
|
+
Cookbooks site. By default, knife will use the username and API key
|
72
|
+
you've configured in your configuration file; otherwise you must
|
73
|
+
explicitly set these values on the command line or use an alternate
|
74
|
+
configuration file.
|
40
75
|
|
41
|
-
|
76
|
+
## UNSHARE
|
77
|
+
__knife cookbook site unshare COOKBOOK__
|
42
78
|
|
43
79
|
Stops sharing the specified cookbook on the Opscode cookbooks site.
|
44
80
|
|
45
|
-
|
81
|
+
## SHOW
|
82
|
+
__knife cookbook site show COOKBOOK [VERSION]__ _(options)_
|
46
83
|
|
47
84
|
Shows information from the site about a particular cookbook.
|
48
85
|
|
49
|
-
|
86
|
+
## DESCRIPTION
|
87
|
+
The cookbook site, <http://community.opscode.com/>, is a cookbook
|
88
|
+
distribution service operated by Opscode. This service provides users
|
89
|
+
with a central location to publish cookbooks for sharing with other
|
90
|
+
community members.
|
50
91
|
|
51
|
-
|
52
|
-
|
92
|
+
`knife cookbook site` commands provide an interface to the cookbook
|
93
|
+
site's HTTP API. For commands that read data from the API, no account is
|
94
|
+
required. In order to upload cookbooks using the `knife cookbook site
|
95
|
+
share` command, you must create an account on the cookbook site and
|
96
|
+
configure your credentials via command line option or in your knife
|
97
|
+
configuration file.
|
53
98
|
|
54
|
-
|
99
|
+
## EXAMPLES
|
100
|
+
Uploading cookbooks to the Opscode cookbooks site:
|
55
101
|
|
102
|
+
knife cookbook site share example Other -k ~/.chef/USERNAME.pem -u USERNAME
|
56
103
|
|
57
104
|
## SEE ALSO
|
58
|
-
__knife-
|
105
|
+
__knife-cookbook(1)__
|
106
|
+
<http://community.opscode.com/cookbooks>
|
59
107
|
|
60
108
|
## AUTHOR
|
61
109
|
Chef was written by Adam Jacob <adam@opscode.com> with many contributions from the community.
|
@@ -1,136 +1,253 @@
|
|
1
|
-
knife-cookbook(1) --
|
1
|
+
knife-cookbook(1) -- upload and manage chef cookbooks
|
2
2
|
========================================
|
3
3
|
|
4
4
|
## SYNOPSIS
|
5
5
|
|
6
6
|
__knife__ __cookbook__ _sub-command_ _(options)_
|
7
7
|
|
8
|
-
##
|
8
|
+
## SUB-COMMANDS
|
9
|
+
`knife cookbook` supports the following sub commands:
|
9
10
|
|
10
|
-
|
11
|
+
## LIST
|
12
|
+
__knife cookbook list__ _(options)_
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
* `-
|
15
|
-
|
16
|
-
|
17
|
-
Delete cookbooks on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
|
18
|
-
|
19
|
-
__cookbook create COOKBOOK__ _(options)_
|
20
|
-
|
21
|
-
* `-o`, `--cookbook-path PATH`:
|
22
|
-
The directory where the cookbook will be created
|
23
|
-
* `-r`, `--readme-format FORMAT`:
|
24
|
-
Format of the README file
|
25
|
-
* `-C`, `--copyright COPYRIGHT`:
|
26
|
-
Name of Copyright holder
|
27
|
-
* `-I`, `--license LICENSE`:
|
28
|
-
License for cookbook, apachev2 or none
|
29
|
-
* `-E`, `--email EMAIL`:
|
30
|
-
Email address of cookbook maintainer
|
31
|
-
|
32
|
-
This is a helper command that creates a new cookbook directory in the `cookbook_path`. The following directories and files are created for the named cookbook.
|
33
|
-
|
34
|
-
* COOKBOOK/attributes
|
35
|
-
* COOKBOOK/definitions
|
36
|
-
* COOKBOOK/files/default
|
37
|
-
* COOKBOOK/libraries
|
38
|
-
* COOKBOOK/metadata.rb
|
39
|
-
* COOKBOOK/providers
|
40
|
-
* COOKBOOK/README.rdoc
|
41
|
-
* COOKBOOK/recipes/default.rb
|
42
|
-
* COOKBOOK/resources
|
43
|
-
* COOKBOOK/templates/default
|
44
|
-
|
45
|
-
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.
|
14
|
+
* `-a`, `--all`:
|
15
|
+
show all versions of a cookbook instead of just the most recent
|
16
|
+
* `-w`, `--with-uri`:
|
17
|
+
show corresponding uris
|
46
18
|
|
47
|
-
|
19
|
+
Lists the cookbooks available on the Chef server.
|
48
20
|
|
49
|
-
|
21
|
+
## SHOW
|
22
|
+
__knife cookbook show cookbook [version] [part] [filename]__ _(options)_
|
50
23
|
|
51
|
-
|
24
|
+
* `-f`, `--fqdn fqdn `:
|
25
|
+
the fqdn of the host to see the file for
|
26
|
+
* `-p`, `--platform platform `:
|
27
|
+
the platform to see the file for
|
28
|
+
* `-v`, `--platform-version version`:
|
29
|
+
the platform version to see the file for
|
52
30
|
|
53
|
-
|
31
|
+
show a particular part of a _cookbook_ for the specified _version_. _part_ can be one of:
|
54
32
|
|
55
|
-
|
56
|
-
|
57
|
-
|
33
|
+
* _attributes_
|
34
|
+
* _definitions_
|
35
|
+
* _files_
|
36
|
+
* _libraries_
|
37
|
+
* _providers_
|
38
|
+
* _recipes_
|
39
|
+
* _resources_
|
40
|
+
* _templates_
|
58
41
|
|
59
|
-
|
42
|
+
## UPLOAD
|
43
|
+
__knife cookbook upload [cookbooks...]__ _(options)_
|
60
44
|
|
61
45
|
* `-a`, `--all`:
|
62
|
-
|
63
|
-
* `-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
46
|
+
upload all cookbooks, rather than just a single cookbook
|
47
|
+
* `-o`, `--cookbook-path path:path`:
|
48
|
+
a colon-separated path to look for cookbooks in
|
49
|
+
* `-E`, `--environment ENVIRONMENT`:
|
50
|
+
An _ENVIRONMENT_ to apply the uploaded cookbooks to. Specifying this
|
51
|
+
option will cause knife to edit the _ENVIRONMENT_ to place a strict
|
52
|
+
version constraint on the cookbook version(s) uploaded.
|
53
|
+
* `--freeze`:
|
54
|
+
Sets the frozen flag on the uploaded cookbook(s) Any future attempt
|
55
|
+
to modify the cookbook without changing the version number will
|
56
|
+
return an error unless --force is specified.
|
57
|
+
* `--force`:
|
58
|
+
Overrides the frozen flag on a cookbook, allowing you to overwrite a
|
59
|
+
cookbook version that has previously been uploaded with the --freeze
|
60
|
+
option.
|
61
|
+
|
62
|
+
Uploads one or more cookbooks from your local cookbook repository(ies)
|
63
|
+
to the Chef Server. Only files that don't yet exist on the server will
|
64
|
+
be uploaded.
|
65
|
+
|
66
|
+
## DOWNLOAD
|
67
|
+
__knife cookbook download cookbook [version]__ _(options)_
|
68
|
+
|
69
|
+
* `-d`, `--dir download_directory`:
|
70
|
+
the directory to download the cookbook into
|
72
71
|
* `-f`, `--force`:
|
73
|
-
|
74
|
-
* `-
|
75
|
-
|
76
|
-
|
77
|
-
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.
|
78
|
-
|
79
|
-
__cookbook list__ _(options)_
|
72
|
+
overwrite an existing directory with the download
|
73
|
+
* `-n`, `--latest`:
|
74
|
+
download the latest version of the cookbook
|
80
75
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
76
|
+
download a cookbook from the chef server. if no version is specified and
|
77
|
+
only one version exists on the server, that version will be downloaded.
|
78
|
+
if no version is specified and multiple versions are available on the
|
79
|
+
server, you will be prompted for a version to download.
|
85
80
|
|
86
|
-
|
81
|
+
## DELETE
|
82
|
+
__knife cookbook delete cookbook [version]__ _(options)_
|
87
83
|
|
88
84
|
* `-a`, `--all`:
|
89
|
-
|
90
|
-
* `-
|
91
|
-
|
92
|
-
|
93
|
-
Generate cookbook metadata for the named _COOKBOOK_. The _PATH_ used here specifies where the cookbooks directory is located and corresponds to the `cookbook_path` configuration option.
|
85
|
+
delete all versions
|
86
|
+
* `-p`, `--purge`:
|
87
|
+
purge files from backing store. this will disable any cookbook that contains any of the same files as the cookbook being purged.
|
94
88
|
|
95
|
-
|
89
|
+
delete the specified _version_ of the named _cookbook_. if no version is
|
90
|
+
specified, and only one version exists on the server, that version will
|
91
|
+
be deleted. if multiple versions are available on the server, you will
|
92
|
+
be prompted for a version to delete.
|
96
93
|
|
97
|
-
|
94
|
+
## BULK DELETE
|
95
|
+
__knife cookbook bulk delete regex__ _(options)_
|
98
96
|
|
99
|
-
|
97
|
+
* `-p`, `--purge`:
|
98
|
+
purge files from backing store. this will disable any cookbook that
|
99
|
+
contains any of the same files as the cookbook being purged.
|
100
|
+
|
101
|
+
delete cookbooks on the chef server based on a regular expression. the
|
102
|
+
regular expression (_regex_) should be in quotes, not in //'s.
|
103
|
+
|
104
|
+
## COOKBOOK CREATE
|
105
|
+
__knife cookbook create cookbook__ _(options)_
|
106
|
+
|
107
|
+
* `-o`, `--cookbook-path path`:
|
108
|
+
the directory where the cookbook will be created
|
109
|
+
* `-r`, `--readme-format format`:
|
110
|
+
format of the readme file
|
111
|
+
* `-c`, `--copyright copyright`:
|
112
|
+
name of copyright holder
|
113
|
+
* `-i`, `--license license`:
|
114
|
+
license for cookbook, apachev2 or none
|
115
|
+
* `-e`, `--email email`:
|
116
|
+
email address of cookbook maintainer
|
117
|
+
|
118
|
+
this is a helper command that creates a new cookbook directory in the
|
119
|
+
`cookbook_path`. the following directories and files are created for the
|
120
|
+
named cookbook.
|
121
|
+
|
122
|
+
* cookbook/attributes
|
123
|
+
* cookbook/definitions
|
124
|
+
* cookbook/files/default
|
125
|
+
* cookbook/libraries
|
126
|
+
* cookbook/metadata.rb
|
127
|
+
* cookbook/providers
|
128
|
+
* cookbook/readme.rdoc
|
129
|
+
* cookbook/recipes/default.rb
|
130
|
+
* cookbook/resources
|
131
|
+
* cookbook/templates/default
|
132
|
+
|
133
|
+
supported readme formats are 'rdoc' (default), 'md', 'mkd', 'txt'. the
|
134
|
+
readme file will be written with the specified extension and a set of
|
135
|
+
helpful starting headers.
|
136
|
+
|
137
|
+
specify `-c` or `--copyright` with the name of the copyright holder as
|
138
|
+
your name or your company/organization name in a quoted string. if this
|
139
|
+
value is not specified an all-caps string `your_company_name` is used
|
140
|
+
which can be easily changed with find/replace.
|
141
|
+
|
142
|
+
specify `-i` or `--license` with the license that the cookbook is
|
143
|
+
distributed under for sharing with other people or posting to the
|
144
|
+
opscode cookbooks site. be aware of the licenses of files you put inside
|
145
|
+
the cookbook and follow any restrictions they describe. when using
|
146
|
+
`none` (default) or `apachev2`, comment header text and metadata file
|
147
|
+
are pre-filled. the `none` license will be treated as
|
148
|
+
non-redistributable.
|
149
|
+
|
150
|
+
specify `-e` or `--email` with the email address of the cookbook's
|
151
|
+
maintainer. if this value is not specified, an all-caps string
|
152
|
+
`your_email` is used which can easily be changed with find/replace.
|
153
|
+
|
154
|
+
the cookbook copyright, license and email settings can be filled in the
|
155
|
+
`knife.rb`, for example with default values:
|
156
|
+
|
157
|
+
cookbook_copyright "your_company_name"
|
158
|
+
cookbook_license "none"
|
159
|
+
cookbook_email "your_email"
|
100
160
|
|
101
|
-
* `-f`, `--fqdn FQDN `:
|
102
|
-
The FQDN of the host to see the file for
|
103
|
-
* `-p`, `--platform PLATFORM `:
|
104
|
-
The platform to see the file for
|
105
|
-
* `-V`, `--platform-version VERSION`:
|
106
|
-
The platform version to see the file for
|
107
161
|
|
108
|
-
|
109
|
-
|
110
|
-
* _attributes_
|
111
|
-
* _definitions_
|
112
|
-
* _files_
|
113
|
-
* _libraries_
|
114
|
-
* _providers_
|
115
|
-
* _recipes_
|
116
|
-
* _resources_
|
117
|
-
* _templates_
|
118
|
-
|
119
|
-
__cookbook test [COOKBOOKS...]__ _(options)_
|
162
|
+
## METADATA
|
163
|
+
__knife cookbook metadata cookbook__ _(options)_
|
120
164
|
|
121
165
|
* `-a`, `--all`:
|
122
|
-
|
123
|
-
* `-o`, `--cookbook-path
|
124
|
-
|
166
|
+
generate metadata for all cookbooks, rather than just a single cookbook
|
167
|
+
* `-o`, `--cookbook-path path:path`:
|
168
|
+
a colon-separated path to look for cookbooks in
|
125
169
|
|
126
|
-
|
170
|
+
generate cookbook metadata for the named _cookbook_. the _path_ used here specifies where the cookbooks directory is located and corresponds to the `cookbook_path` configuration option.
|
127
171
|
|
128
|
-
|
172
|
+
## METADATA FROM FILE
|
173
|
+
__knife cookbook metadata from file__ _(options)_
|
129
174
|
|
130
|
-
|
131
|
-
Upload all cookbooks, rather than just a single cookbook
|
132
|
-
* `-o`, `--cookbook-path PATH:PATH`:
|
133
|
-
A colon-separated path to look for cookbooks in
|
175
|
+
load the cookbook metadata from a specified file.
|
134
176
|
|
135
|
-
|
177
|
+
## TEST
|
178
|
+
__knife cookbook test [cookbooks...]__ _(options)_
|
136
179
|
|
180
|
+
* `-a`, `--all`:
|
181
|
+
test all cookbooks, rather than just a single cookbook
|
182
|
+
* `-o`, `--cookbook-path path:path`:
|
183
|
+
a colon-separated path to look for cookbooks in
|
184
|
+
|
185
|
+
test the specified cookbooks for syntax errors. this uses the built-in
|
186
|
+
ruby syntax checking option for files in the cookbook ending in `.rb`,
|
187
|
+
and the erb syntax check for files ending in `.erb` (templates).
|
188
|
+
|
189
|
+
## RECIPE LIST
|
190
|
+
__knife recipe list [PATTERN]__
|
191
|
+
|
192
|
+
List available recipes from the server. Specify _PATTERN_ as a regular
|
193
|
+
expression to limit the results.
|
194
|
+
|
195
|
+
## DESCRIPTION
|
196
|
+
Cookbooks are the fundamental unit of distribution in Chef. They
|
197
|
+
encapsulate all recipes of resources and assets used to configure a
|
198
|
+
particular aspect of the infrastructure. The following sub-commands can
|
199
|
+
be used to manipulate the cookbooks stored on the Chef Server.
|
200
|
+
|
201
|
+
On disk, cookbooks are directories with a defined structure. The
|
202
|
+
following directories may appear within a cookbook:
|
203
|
+
|
204
|
+
* COOKBOOK/attributes/:
|
205
|
+
Ruby files that define default parameters to be used in recipes
|
206
|
+
* COOKBOOK/definitions/:
|
207
|
+
Ruby files that contain _resource definitions_
|
208
|
+
* COOKBOOK/files/SPECIFICITY:
|
209
|
+
Files of arbitrary type. These files may be downloaded by
|
210
|
+
chef-client(8) when configuring a host.
|
211
|
+
* COOKBOOK/libraries/:
|
212
|
+
Ruby files that contain library code needed for recipes
|
213
|
+
* COOKBOOK/providers/:
|
214
|
+
Ruby files that contain Lightweight Provider definitions
|
215
|
+
* COOKBOOK/recipes/:
|
216
|
+
Ruby files that use Chef's recipe DSL to describe the desired
|
217
|
+
configuration of a system
|
218
|
+
* COOKBOOK/resources/:
|
219
|
+
Ruby files that contain Lightweight Resource definitions
|
220
|
+
* COOKBOOK/templates/SPECIFICITY:
|
221
|
+
ERuby (ERb) template files. These are referenced by _recipes_ and
|
222
|
+
evaluated to dynamically generate configuration files.
|
223
|
+
|
224
|
+
__SPECIFICITY__ is a feature of _files_ and _templates_ that allow you
|
225
|
+
to specify alternate files to be used on a specific OS platform or host.
|
226
|
+
The default specificity setting is _default_, that is files in
|
227
|
+
`COOKBOOK/files/default` will be used when a more specific copy is not
|
228
|
+
available. Further documentation for this feature is available on the
|
229
|
+
Chef wiki: <http://wiki.opscode.com/display/chef/File+Distribution#FileDistribution-FileSpecificity>
|
230
|
+
|
231
|
+
Cookbooks also contain a metadata file that defines various properties
|
232
|
+
of the cookbook. The most important of these are the _version_ and the
|
233
|
+
_dependencies_. The _version_ is used in combination with environments
|
234
|
+
to select which copy of a given cookbook is distributed to a node. The
|
235
|
+
_dependencies_ are used by the server to determine which additional
|
236
|
+
cookbooks must be distributed to a given host when it requires a
|
237
|
+
cookbook.
|
238
|
+
|
239
|
+
## SEE ALSO
|
240
|
+
__knife-environment(1)__ __knife-cookbook-site(1)__
|
241
|
+
<http://wiki.opscode.com/display/chef/Cookbooks>
|
242
|
+
<http://wiki.opscode.com/display/chef/Metadata>
|
243
|
+
|
244
|
+
## AUTHOR
|
245
|
+
Chef was written by Adam Jacob <adam@opscode.com> with many contributions from the community.
|
246
|
+
|
247
|
+
## DOCUMENTATION
|
248
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com>.
|
249
|
+
Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
250
|
+
|
251
|
+
|
252
|
+
## CHEF
|
253
|
+
Knife is distributed with Chef. <http://wiki.opscode.com/display/chef/Home>
|