chef 0.8.16 → 0.9.0.a3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of chef might be problematic. Click here for more details.
- data/bin/shef +1 -0
- data/distro/common/man/man1/chef-server-webui.1 +106 -0
- data/distro/common/man/man1/chef-server.1 +0 -1
- data/distro/common/man/man1/chef-solr-indexer.1 +55 -0
- data/distro/common/man/man1/chef-solr.1 +55 -0
- data/distro/common/man/man8/chef-client.8 +4 -2
- data/distro/common/man/man8/chef-solo.8 +1 -2
- data/distro/common/man/man8/chef-solr-rebuild.8 +37 -0
- data/distro/common/man/man8/knife.8 +668 -266
- data/distro/common/man/man8/shef.8 +45 -0
- data/distro/common/markdown/README +3 -0
- data/distro/common/markdown/knife.mkd +520 -0
- data/distro/debian/etc/default/chef-client +4 -0
- data/distro/debian/etc/default/chef-server +6 -0
- data/distro/debian/etc/default/chef-server-webui +6 -0
- data/distro/debian/etc/default/chef-solr +4 -0
- data/distro/debian/etc/default/chef-solr-indexer +4 -0
- data/distro/debian/etc/init.d/chef-client +41 -41
- data/distro/debian/etc/init.d/chef-server +10 -10
- data/distro/debian/etc/init.d/chef-server-webui +121 -0
- data/distro/debian/etc/init.d/chef-solr +177 -0
- data/distro/debian/etc/init.d/chef-solr-indexer +176 -0
- data/distro/redhat/etc/init.d/chef-client +76 -48
- data/distro/redhat/etc/init.d/chef-server +85 -51
- data/distro/redhat/etc/init.d/chef-server-webui +85 -51
- data/distro/redhat/etc/init.d/chef-solr +77 -49
- data/distro/redhat/etc/init.d/chef-solr-indexer +77 -48
- data/distro/redhat/etc/logrotate.d/chef-client +8 -0
- data/distro/redhat/etc/logrotate.d/chef-server +8 -0
- data/distro/redhat/etc/logrotate.d/chef-server-webui +8 -0
- data/distro/redhat/etc/logrotate.d/chef-solr +8 -0
- data/distro/redhat/etc/logrotate.d/chef-solr-indexer +8 -0
- data/distro/redhat/etc/sysconfig/chef-client +9 -4
- data/distro/redhat/etc/sysconfig/chef-server +10 -6
- data/distro/redhat/etc/sysconfig/chef-server-webui +10 -6
- data/distro/redhat/etc/sysconfig/chef-solr +3 -4
- data/distro/redhat/etc/sysconfig/chef-solr-indexer +3 -3
- data/lib/chef.rb +16 -5
- data/lib/chef/application/knife.rb +2 -2
- data/lib/chef/application/solo.rb +1 -7
- data/lib/chef/cache/checksum.rb +12 -5
- data/lib/chef/cache/file_cache_by_checksum.rb +52 -0
- data/lib/chef/checksum.rb +115 -0
- data/lib/chef/client.rb +193 -185
- data/lib/chef/config.rb +9 -1
- data/lib/chef/cookbook/cookbook_collection.rb +43 -0
- data/lib/chef/cookbook/file_system_file_vendor.rb +53 -0
- data/lib/chef/cookbook/file_vendor.rb +47 -0
- data/lib/chef/cookbook/metadata.rb +34 -35
- data/lib/chef/cookbook/metadata/version.rb +1 -1
- data/lib/chef/cookbook_loader.rb +70 -45
- data/lib/chef/cookbook_version.rb +760 -0
- data/lib/chef/couchdb.rb +8 -5
- data/lib/chef/data_bag_item.rb +5 -5
- data/lib/chef/exceptions.rb +10 -0
- data/lib/chef/file_access_control.rb +134 -0
- data/lib/chef/handler.rb +62 -0
- data/lib/chef/handler/json_file.rb +47 -0
- data/lib/chef/knife.rb +14 -2
- data/lib/chef/knife/bootstrap.rb +126 -0
- data/lib/chef/knife/cookbook_bulk_delete.rb +1 -1
- data/lib/chef/knife/cookbook_delete.rb +4 -4
- data/lib/chef/knife/cookbook_download.rb +57 -26
- data/lib/chef/knife/cookbook_metadata.rb +2 -2
- data/lib/chef/knife/cookbook_show.rb +30 -11
- data/lib/chef/knife/cookbook_upload.rb +113 -86
- data/lib/chef/knife/ec2_server_create.rb +146 -0
- data/lib/chef/knife/ec2_server_delete.rb +84 -0
- data/lib/chef/knife/ec2_server_list.rb +82 -0
- data/lib/chef/knife/status.rb +51 -0
- data/lib/chef/mixin/language_include_attribute.rb +16 -11
- data/lib/chef/mixin/language_include_recipe.rb +15 -16
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +17 -20
- data/lib/chef/mixin/shell_out.rb +38 -0
- data/lib/chef/mixins.rb +1 -1
- data/lib/chef/node.rb +190 -63
- data/lib/chef/node/attribute.rb +92 -78
- data/lib/chef/platform.rb +24 -4
- data/lib/chef/provider.rb +28 -10
- data/lib/chef/provider/breakpoint.rb +2 -2
- data/lib/chef/provider/cookbook_file.rb +96 -0
- data/lib/chef/provider/cron.rb +2 -2
- data/lib/chef/provider/deploy.rb +12 -10
- data/lib/chef/provider/env.rb +152 -0
- data/lib/chef/provider/env/windows.rb +75 -0
- data/lib/chef/provider/file.rb +10 -14
- data/lib/chef/provider/group.rb +15 -2
- data/lib/chef/provider/group/dscl.rb +17 -25
- data/lib/chef/provider/group/gpasswd.rb +6 -3
- data/lib/chef/provider/group/pw.rb +3 -7
- data/lib/chef/provider/group/windows.rb +79 -0
- data/lib/chef/provider/link.rb +4 -5
- data/lib/chef/provider/mdadm.rb +25 -18
- data/lib/chef/provider/mount/mount.rb +28 -27
- data/lib/chef/provider/package.rb +35 -35
- data/lib/chef/provider/package/dpkg.rb +13 -10
- data/lib/chef/provider/package/easy_install.rb +6 -6
- data/lib/chef/provider/package/freebsd.rb +17 -51
- data/lib/chef/provider/package/rpm.rb +1 -1
- data/lib/chef/provider/package/rubygems.rb +391 -74
- data/lib/chef/provider/package/yum.rb +2 -2
- data/lib/chef/provider/package/zypper.rb +2 -1
- data/lib/chef/provider/remote_directory.rb +60 -83
- data/lib/chef/provider/remote_file.rb +17 -66
- data/lib/chef/provider/script.rb +20 -9
- data/lib/chef/provider/service.rb +23 -30
- data/lib/chef/provider/service/arch.rb +3 -3
- data/lib/chef/provider/service/debian.rb +22 -17
- data/lib/chef/provider/service/freebsd.rb +4 -4
- data/lib/chef/provider/service/init.rb +2 -2
- data/lib/chef/provider/service/redhat.rb +14 -16
- data/lib/chef/provider/service/simple.rb +7 -3
- data/lib/chef/provider/service/solaris.rb +85 -0
- data/lib/chef/provider/service/upstart.rb +12 -7
- data/lib/chef/provider/service/windows.rb +2 -2
- data/lib/chef/provider/template.rb +133 -118
- data/lib/chef/provider/user.rb +34 -17
- data/lib/chef/provider/user/dscl.rb +117 -114
- data/lib/chef/provider/user/windows.rb +124 -0
- data/lib/chef/providers.rb +7 -0
- data/lib/chef/recipe.rb +39 -20
- data/lib/chef/resource.rb +47 -52
- data/lib/chef/resource/apt_package.rb +4 -4
- data/lib/chef/resource/bash.rb +4 -4
- data/lib/chef/resource/cookbook_file.rb +45 -0
- data/lib/chef/resource/cron.rb +3 -3
- data/lib/chef/resource/csh.rb +4 -4
- data/lib/chef/resource/deploy.rb +3 -3
- data/lib/chef/resource/directory.rb +4 -4
- data/lib/chef/resource/dpkg_package.rb +4 -4
- data/lib/chef/resource/easy_install_package.rb +3 -3
- data/lib/chef/resource/env.rb +58 -0
- data/lib/chef/resource/erl_call.rb +3 -3
- data/lib/chef/resource/execute.rb +3 -3
- data/lib/chef/resource/file.rb +3 -3
- data/lib/chef/resource/freebsd_package.rb +3 -3
- data/lib/chef/resource/gem_package.rb +17 -9
- data/lib/chef/resource/git.rb +3 -3
- data/lib/chef/resource/group.rb +3 -3
- data/lib/chef/resource/http_request.rb +4 -4
- data/lib/chef/resource/ifconfig.rb +3 -3
- data/lib/chef/resource/link.rb +3 -3
- data/lib/chef/resource/log.rb +2 -2
- data/lib/chef/resource/macports_package.rb +2 -2
- data/lib/chef/resource/mdadm.rb +3 -3
- data/lib/chef/resource/mount.rb +2 -2
- data/lib/chef/resource/package.rb +4 -4
- data/lib/chef/resource/pacman_package.rb +4 -4
- data/lib/chef/resource/perl.rb +4 -4
- data/lib/chef/resource/portage_package.rb +4 -4
- data/lib/chef/resource/python.rb +4 -4
- data/lib/chef/resource/remote_directory.rb +3 -3
- data/lib/chef/resource/remote_file.rb +26 -3
- data/lib/chef/resource/route.rb +3 -3
- data/lib/chef/resource/ruby.rb +3 -3
- data/lib/chef/resource/ruby_block.rb +3 -2
- data/lib/chef/resource/scm.rb +7 -5
- data/lib/chef/resource/script.rb +4 -4
- data/lib/chef/resource/service.rb +3 -3
- data/lib/chef/resource/subversion.rb +4 -2
- data/lib/chef/resource/template.rb +3 -3
- data/lib/chef/resource/user.rb +3 -3
- data/lib/chef/resource/yum_package.rb +3 -3
- data/lib/chef/resource_collection.rb +9 -5
- data/lib/chef/resources.rb +2 -0
- data/lib/chef/rest.rb +4 -0
- data/lib/chef/role.rb +2 -0
- data/lib/chef/run_context.rb +108 -0
- data/lib/chef/run_list.rb +75 -98
- data/lib/chef/run_list/run_list_expansion.rb +156 -0
- data/lib/chef/run_list/run_list_item.rb +71 -0
- data/lib/chef/runner.rb +58 -61
- data/lib/chef/sandbox.rb +147 -0
- data/lib/chef/shef.rb +4 -3
- data/lib/chef/shef/ext.rb +12 -4
- data/lib/chef/shef/shef_session.rb +27 -23
- data/lib/chef/shell_out.rb +375 -0
- data/lib/chef/util/windows.rb +56 -0
- data/lib/chef/util/windows/net_group.rb +101 -0
- data/lib/chef/util/windows/net_user.rb +198 -0
- data/lib/chef/version.rb +20 -0
- metadata +112 -22
- data/lib/chef/compile.rb +0 -158
- data/lib/chef/cookbook.rb +0 -201
- data/lib/chef/mixin/generate_url.rb +0 -58
@@ -0,0 +1,45 @@
|
|
1
|
+
.TH SHEF: "8" "March 2010" "Chef: 0.8.4" "System Administration Utilities"
|
2
|
+
.SH NAME
|
3
|
+
shef: \- Run Chef in an IRB session.
|
4
|
+
.SH SYNOPSIS
|
5
|
+
.B shef
|
6
|
+
\fI(options)\fR
|
7
|
+
.SH DESCRIPTION
|
8
|
+
.TP
|
9
|
+
This manual page documents shef, a command-line REPL console used to run Chef in an IRB session. It includes recipe and attribute file syntax, and interactive debugging features.
|
10
|
+
\fB\-S\fR, \fB\-\-server\fR CHEFSERVERURL
|
11
|
+
The chef server URL
|
12
|
+
.TP
|
13
|
+
\fB\-z\fR, \fB\-\-client\fR
|
14
|
+
chef\-client shef session
|
15
|
+
.TP
|
16
|
+
\fB\-c\fR, \fB\-\-config\fR CONFIG
|
17
|
+
The configuration file to use
|
18
|
+
.TP
|
19
|
+
\fB\-j\fR JSON_ATTRIBS
|
20
|
+
Load attributes from a JSON file or URL
|
21
|
+
.HP
|
22
|
+
\fB\-\-json\-attributes\fR
|
23
|
+
.TP
|
24
|
+
\fB\-s\fR, \fB\-\-solo\fR
|
25
|
+
chef\-solo shef session
|
26
|
+
.TP
|
27
|
+
\fB\-a\fR, \fB\-\-standalone\fR
|
28
|
+
standalone shef session
|
29
|
+
.TP
|
30
|
+
\fB\-v\fR, \fB\-\-version\fR
|
31
|
+
Show chef version
|
32
|
+
.TP
|
33
|
+
\fB\-h\fR, \fB\-\-help\fR
|
34
|
+
Show this message
|
35
|
+
.SH "SEE ALSO"
|
36
|
+
The full documentation for
|
37
|
+
.B shef
|
38
|
+
is maintained on the Chef wiki, http://wiki.opscode.com/display/chef/Shef/.
|
39
|
+
.SH AUTHOR
|
40
|
+
Shef was written by Daniel DeLeo <dan@kallistec.com> as part of Chef, by Opscode, Inc.
|
41
|
+
This manual page was written by Joshua Timberman <joshua@opscode.com> with help2man. Permission is granted
|
42
|
+
to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
43
|
+
.PP
|
44
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in
|
45
|
+
/usr/share/common-licenses/Apache-2.0.
|
@@ -0,0 +1,520 @@
|
|
1
|
+
knife(8) -- Chef Server REST API utility
|
2
|
+
========================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
__knife__ _sub-command_ _(options)_
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
This manual page documents knife, a command-line utility used to interact with a Chef server directly through the RESTful API. Knife uses sub-commands to take various actions on different types of Chef objects. Some sub-commands take additional options. General options follow sub-commands and their options. A configuration file can be created for common defaults.
|
11
|
+
|
12
|
+
Unless otherwise specified, output is in JSON format, and input files are also JSON format.
|
13
|
+
|
14
|
+
## GENERAL OPTIONS
|
15
|
+
|
16
|
+
* `-s`, `--server-url` URL:
|
17
|
+
Chef Server URL
|
18
|
+
* `-k`, `--key` KEY:
|
19
|
+
API Client Key
|
20
|
+
* `-c`, `--config` CONFIG:
|
21
|
+
The configuration file to use
|
22
|
+
* `-e`, `--editor` EDITOR:
|
23
|
+
Set the editor to use for interactive commands
|
24
|
+
* `-f`, `--format` FORMAT:
|
25
|
+
Which format to use for output
|
26
|
+
* `-l`, `--log_level` LEVEL:
|
27
|
+
Set the log level (debug, info, warn, error, fatal)
|
28
|
+
* `-L`, `--logfile` LOGLOCATION:
|
29
|
+
Set the log file location, defaults to STDOUT
|
30
|
+
* `-n`, `--no-editor`:
|
31
|
+
Do not open EDITOR, just accept the data as is
|
32
|
+
* `-u`, `--user` USER:
|
33
|
+
API Client Username
|
34
|
+
* `-p`, `--print-after`:
|
35
|
+
Show the data after a destructive operation
|
36
|
+
* `-v`, `--version`:
|
37
|
+
Show chef version
|
38
|
+
* `-y`, `--yes`:
|
39
|
+
Say yes to all prompts for confirmation
|
40
|
+
* `-h`, `--help`:
|
41
|
+
Show this message
|
42
|
+
|
43
|
+
## SUB-COMMANDS
|
44
|
+
|
45
|
+
Knife sub-commands are structured as "_NOUN_ __verb__ _NOUN_ (options)". The sub-commands are meant to be intuitively named. Because the Chef Server API is RESTful, sub-commands generally utilize CRUD operations.
|
46
|
+
|
47
|
+
* create (create)
|
48
|
+
* list and show (read)
|
49
|
+
* edit (update)
|
50
|
+
* delete (destroy)
|
51
|
+
|
52
|
+
Objects stored on the server support these, as described below.
|
53
|
+
|
54
|
+
## GENERAL SUB-COMMANDS
|
55
|
+
|
56
|
+
The following are general sub-commands that do not fit within the other object types utilized in the Chef Server API.
|
57
|
+
|
58
|
+
__configure__ _(options)_
|
59
|
+
|
60
|
+
* `-i`, `--initial`:
|
61
|
+
Create an initial API Client
|
62
|
+
* `-r`, `--repository REPO`:
|
63
|
+
The path to your chef-repo
|
64
|
+
|
65
|
+
Create a configuration file for knife. This will prompt for values to enter into the file. Default values are listed in square brackets if no other entry is typed. See "__CONFIGURATION__" below for available options.
|
66
|
+
|
67
|
+
__index rebuild__ _(options)_
|
68
|
+
|
69
|
+
* `-y`, `--yes`:
|
70
|
+
don't bother to ask if I'm sure
|
71
|
+
|
72
|
+
Rebuilds all the search indexes on the server.
|
73
|
+
|
74
|
+
__search INDEX QUERY__ _(options)_
|
75
|
+
|
76
|
+
* `-a`, `--attribute ATTR`:
|
77
|
+
Show only one attribute
|
78
|
+
* `-i`, `--id-only`:
|
79
|
+
Show only the ID of matching objects
|
80
|
+
* `-R`, `--rows INT`:
|
81
|
+
The number of rows to return
|
82
|
+
* `-r`, `--run-list`:
|
83
|
+
Show only the run list
|
84
|
+
* `-o`, `--sort SORT`:
|
85
|
+
The order to sort the results in
|
86
|
+
* `-b`, `--start ROW`:
|
87
|
+
The row to start returning results at
|
88
|
+
|
89
|
+
Search indexes are a feature of the Chef Server and the search sub-command allows querying any of the available indexes using SOLR query syntax. The following data types are indexed for search: _node_, _role_, _client_, _data bag_.
|
90
|
+
|
91
|
+
__ssh QUERY COMMAND__ _(options)_
|
92
|
+
|
93
|
+
* `-a`, `--attribute ATTR `:
|
94
|
+
The attribute to use for opening the connection - default is fqdn
|
95
|
+
* `-C`, `--concurrency NUM `:
|
96
|
+
The number of concurrent connections
|
97
|
+
* `-m`, `--manual-list `:
|
98
|
+
QUERY is a space separated list of servers
|
99
|
+
* `-P`, `--ssh-password PASSWORD`:
|
100
|
+
The ssh password
|
101
|
+
* `-x`, `--ssh-user USERNAME `:
|
102
|
+
The ssh username
|
103
|
+
|
104
|
+
The __ssh__ sub-command opens an ssh session to each of the nodes in the search results of the _QUERY_. This sub-command requires that the net-ssh-multi and highline Ruby libraries are installed. On Debian systems, these are the libnet-ssh-multi-ruby and libhighline-ruby packages. They can also be installed as RubyGems (net-ssh-multi and highline, respectively).
|
105
|
+
|
106
|
+
## CLIENT SUB-COMMANDS
|
107
|
+
|
108
|
+
Clients are entities that communicate with the Chef Server API.
|
109
|
+
|
110
|
+
__client bulk delete REGEX__ _(options)_
|
111
|
+
|
112
|
+
Delete clients on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
|
113
|
+
|
114
|
+
__client create CLIENT__ _(options)_
|
115
|
+
|
116
|
+
* `-a`, `--admin `:
|
117
|
+
Create the client as an admin
|
118
|
+
* `-f`, `--file FILE`:
|
119
|
+
Write the key to a file
|
120
|
+
|
121
|
+
Create a new client. This generates an RSA keypair. The private key will be displayed on _STDOUT_ or written to the named file. The public half will be stored on the Server. For _chef-client_ systems, the private key should be copied to the system as `/etc/chef/client.pem`.
|
122
|
+
|
123
|
+
Admin clients should be created for users that will use _knife_ to access the API as an administrator. The private key will generally be copied to `~/.chef/CLIENT.pem` and referenced in the `knife.rb` configuration file.
|
124
|
+
|
125
|
+
__client delete CLIENT__ _(options)_
|
126
|
+
|
127
|
+
Deletes a registered client.
|
128
|
+
|
129
|
+
__client edit CLIENT__ _(options)_
|
130
|
+
|
131
|
+
Edit a registered client.
|
132
|
+
|
133
|
+
__client list__ _(options)_
|
134
|
+
|
135
|
+
* `-w`, `--with-uri`:
|
136
|
+
Show corresponding URIs
|
137
|
+
|
138
|
+
List all registered clients.
|
139
|
+
|
140
|
+
__client reregister CLIENT__ _(options)_
|
141
|
+
|
142
|
+
* `-f`, `--file FILE`:
|
143
|
+
Write the key to a file
|
144
|
+
|
145
|
+
Regenerate the RSA keypair for a client. The public half will be stored on the server and the private key displayed on _STDOUT_ or written to the named file.
|
146
|
+
|
147
|
+
__client show CLIENT__ _(options)_
|
148
|
+
|
149
|
+
* `-a`, `--attribute ATTR`:
|
150
|
+
Show only one attribute
|
151
|
+
|
152
|
+
Show a client.
|
153
|
+
|
154
|
+
## COOKBOOK SUB-COMMANDS
|
155
|
+
|
156
|
+
Cookbooks are the fundamental unit of distribution in Chef. They encapsulate all recipes of resources and assets used to configure a particular aspect of the infrastructure. The following sub-commands can be used to manipulate the cookbooks stored on the Chef Server.
|
157
|
+
|
158
|
+
__cookbook bulk delete REGEX__ _(options)_
|
159
|
+
|
160
|
+
Delete cookbooks on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
|
161
|
+
|
162
|
+
__cookbook delete COOKBOOK__ _(options)_
|
163
|
+
|
164
|
+
Delete a single named _COOKBOOK_.
|
165
|
+
|
166
|
+
__cookbook download COOKBOOK__ _(options)_
|
167
|
+
|
168
|
+
* `-f`, `--file FILE`:
|
169
|
+
The filename to write to
|
170
|
+
|
171
|
+
Download a cookbook from the Chef Server as a gzip(1)'ed, tar(1) archive.
|
172
|
+
|
173
|
+
__cookbook list__ _(options)_
|
174
|
+
|
175
|
+
* `-w`, `--with-uri`:
|
176
|
+
Show corresponding URIs
|
177
|
+
|
178
|
+
List all the cookbooks.
|
179
|
+
|
180
|
+
__cookbook metadata COOKBOOK__ _(options)_
|
181
|
+
|
182
|
+
* `-a`, `--all`:
|
183
|
+
Generate metadata for all cookbooks, rather than just a single cookbook
|
184
|
+
* `-o`, `--cookbook-path PATH:PATH`:
|
185
|
+
A colon-separated path to look for cookbooks in
|
186
|
+
|
187
|
+
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.
|
188
|
+
|
189
|
+
__cookbook metadata from FILE__ _(options)_
|
190
|
+
|
191
|
+
Load the cookbook metadata from a specified file.
|
192
|
+
|
193
|
+
__cookbook show COOKBOOK [PART] [FILENAME]__ _(options)_
|
194
|
+
|
195
|
+
* `-f`, `--fqdn FQDN `:
|
196
|
+
The FQDN of the host to see the file for
|
197
|
+
* `-p`, `--platform PLATFORM `:
|
198
|
+
The platform to see the file for
|
199
|
+
* `-V`, `--platform-version VERSION`:
|
200
|
+
The platform version to see the file for
|
201
|
+
|
202
|
+
Show a particular part of a _COOKBOOK_. _PART_ can be one of:
|
203
|
+
|
204
|
+
* _attributes_
|
205
|
+
* _definitions_
|
206
|
+
* _files_
|
207
|
+
* _libraries_
|
208
|
+
* _providers_
|
209
|
+
* _recipes_
|
210
|
+
* _resources_
|
211
|
+
* _templates_
|
212
|
+
|
213
|
+
__cookbook test [COOKBOOKS...]__ _(options)_
|
214
|
+
|
215
|
+
* `-a`, `--all`:
|
216
|
+
Test all cookbooks, rather than just a single cookbook
|
217
|
+
* `-o`, `--cookbook-path PATH:PATH`:
|
218
|
+
A colon-separated path to look for cookbooks in
|
219
|
+
|
220
|
+
Test the specified cookbooks for syntax errors. This uses the built-in Ruby syntax checking option for files in the cookbook ending in `.rb`, and the ERB syntax check for files ending in `.erb` (templates).
|
221
|
+
|
222
|
+
__cookbook upload [COOKBOOKS...]__ _(options)_
|
223
|
+
|
224
|
+
* `-a`, `--all`:
|
225
|
+
Upload all cookbooks, rather than just a single cookbook
|
226
|
+
* `-o`, `--cookbook-path PATH:PATH`:
|
227
|
+
A colon-separated path to look for cookbooks in
|
228
|
+
|
229
|
+
Uploads the specified cookbooks to the Chef Server. The actual upload executes a number of commands, most of which occur on the local machine. The cookbook is staged in a temporary location. Then the `cookbook_path` (or `-o PATH`) is processed to search for the named cookbook, and each occurance is copied in the order specified. A syntax check is performed a la `cookbook test`, above. The metadata is generated, a la `cookbook metadata`. A gzip(1)'ed, tar(1) file is created, and is uploaded to the server.
|
230
|
+
|
231
|
+
## COOKBOOK SITE SUB-COMMANDS
|
232
|
+
|
233
|
+
The following sub-commands are still in the context of cookbooks, but they make use of Opscode's Cookbook Community site, _http://cookbooks.opscode.com/_. That site has an API, and these sub-commands utilize that API, rather than the Chef Server API.
|
234
|
+
|
235
|
+
__cookbook site download COOKBOOK [VERSION]__ _(options)_
|
236
|
+
|
237
|
+
* `-f`, `--file FILE`:
|
238
|
+
The filename to write to
|
239
|
+
|
240
|
+
Downloads a specific cookbook from the Community site, optionally specifying a certain version.
|
241
|
+
|
242
|
+
__cookbook site list__ _(options)_
|
243
|
+
|
244
|
+
* `-w`, `--with-uri`:
|
245
|
+
Show corresponding URIs
|
246
|
+
|
247
|
+
Lists available cookbooks from the Community site.
|
248
|
+
|
249
|
+
__cookbook site search QUERY__ _(options)_
|
250
|
+
|
251
|
+
Searches the Community site with the specified query.
|
252
|
+
|
253
|
+
__cookbook site show COOKBOOK [VERSION]__ _(options)_
|
254
|
+
|
255
|
+
Shows information from the site about a particular cookbook.
|
256
|
+
|
257
|
+
__cookbook site vendor COOKBOOK [VERSION]__ _(options)_
|
258
|
+
|
259
|
+
* `-d`, `--dependencies`:
|
260
|
+
Grab dependencies automatically
|
261
|
+
|
262
|
+
Downloads a cookbook and untars it in the cookbooks directory. If _-d_ is specified, all the cookbooks it depends on (via metadata _dependencies_) are downloaded and untarred as well.
|
263
|
+
|
264
|
+
## DATA BAG SUB-COMMANDS
|
265
|
+
|
266
|
+
Data bags are stores of JSON blobs. These blobs are called items. They are free form JSON and indexed by the Chef Server.
|
267
|
+
|
268
|
+
__data bag create BAG [ITEM]__ _(options)_
|
269
|
+
|
270
|
+
Create a new data bag, or an item in a data bag.
|
271
|
+
|
272
|
+
__data bag delete BAG [ITEM]__ _(options)_
|
273
|
+
|
274
|
+
Delete a data bag, or an item from a data bag.
|
275
|
+
|
276
|
+
__data bag edit BAG ITEM__ _(options)_
|
277
|
+
|
278
|
+
Edit an item in a data bag.
|
279
|
+
|
280
|
+
__data bag list__ _(options)_
|
281
|
+
|
282
|
+
* `-w`, `--with-uri`:
|
283
|
+
Show corresponding URIs
|
284
|
+
|
285
|
+
List the available data bags.
|
286
|
+
|
287
|
+
__data bag show BAG [ITEM]__ _(options)_
|
288
|
+
|
289
|
+
Show a specific data bag or an item in a data bag.
|
290
|
+
|
291
|
+
## NODE SUB-COMMANDS
|
292
|
+
|
293
|
+
Nodes are the entities which are configured with Chef. Typically these are servers or workstations. Nodes are registered as a client, by default by the fully qualified domain name (fqdn). A single client may configure more than one node.
|
294
|
+
|
295
|
+
__node bulk delete REGEX__ _(options)_
|
296
|
+
|
297
|
+
Delete nodes on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
|
298
|
+
|
299
|
+
__node create NODE__ _(options)_
|
300
|
+
|
301
|
+
Create a new node.
|
302
|
+
|
303
|
+
__node delete NODE__ _(options)_
|
304
|
+
|
305
|
+
Delete a single node.
|
306
|
+
|
307
|
+
__node edit NODE__ _(options)_
|
308
|
+
|
309
|
+
Edit a node.
|
310
|
+
|
311
|
+
__node from file FILE__ _(options)_
|
312
|
+
|
313
|
+
Create a node from a JSON file.
|
314
|
+
|
315
|
+
__node list__ _(options)_
|
316
|
+
|
317
|
+
* `-w`, `--with-uri`:
|
318
|
+
Show corresponding URIs
|
319
|
+
|
320
|
+
List all nodes.
|
321
|
+
|
322
|
+
`node run_list add [NODE] [ENTRY]` _(options)_
|
323
|
+
|
324
|
+
* `-a`, `--after ITEM`:
|
325
|
+
Place the ENTRY in the run list after ITEM
|
326
|
+
|
327
|
+
Add a recipe or role to the node's `run_list`.
|
328
|
+
|
329
|
+
`node run_list remove [NODE] [ENTRY]` _(options)_
|
330
|
+
|
331
|
+
Remove a recipe or role from the node's `run_list`.
|
332
|
+
|
333
|
+
__node show NODE__ _(options)_
|
334
|
+
|
335
|
+
* `-a`, `--attribute [ATTR]`:
|
336
|
+
Show only one attribute
|
337
|
+
* `-r`, `--run-list `:
|
338
|
+
Show only the run list
|
339
|
+
|
340
|
+
Show a node.
|
341
|
+
|
342
|
+
## ROLE SUB-COMMANDS
|
343
|
+
|
344
|
+
__role bulk delete REGEX__ _(options)_
|
345
|
+
|
346
|
+
Delete roles on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
|
347
|
+
|
348
|
+
__role create ROLE__ _(options)_
|
349
|
+
|
350
|
+
* `-d`, `--description`:
|
351
|
+
The role description
|
352
|
+
|
353
|
+
Create a new role.
|
354
|
+
|
355
|
+
__role delete ROLE__ _(options)_
|
356
|
+
|
357
|
+
Delete a role.
|
358
|
+
|
359
|
+
__role edit ROLE__ _(options)_
|
360
|
+
|
361
|
+
Edit a role.
|
362
|
+
|
363
|
+
__role from file FILE__ _(options)_
|
364
|
+
|
365
|
+
Create or update a role from a role Ruby DSL (`.rb`) or JSON file.
|
366
|
+
|
367
|
+
__role list__ _(options)_
|
368
|
+
|
369
|
+
* `-w`, `--with-uri`:
|
370
|
+
Show corresponding URIs
|
371
|
+
|
372
|
+
List roles.
|
373
|
+
|
374
|
+
__role show ROLE__ _(options)_
|
375
|
+
|
376
|
+
* `-a`, `--attribute ATTR`:
|
377
|
+
Show only one attribute
|
378
|
+
|
379
|
+
Show a specific role.
|
380
|
+
|
381
|
+
## CLOUD COMPUTING SUB-COMMANDS
|
382
|
+
|
383
|
+
The next sections describe sub-commands to work with various Cloud Computing APIs to launch server instances with validation and run-time configuration that Chef knows about. These sub-commands require the fog Ruby library. On Debian and Ubuntu systems this is the package `libfog-ruby`. It is also available as a RubyGem, `fog`.
|
384
|
+
|
385
|
+
The Rackspace and Terremark sub-commands are early stage of development. Right now when creating instances of these types, knife will assume an Ubuntu image, install Ruby from packages, RubyGems from source and Chef as a RubyGem. As these commands are developed, other installation styles may become available, as options.
|
386
|
+
|
387
|
+
## EC2 SUB-COMMANDS
|
388
|
+
|
389
|
+
Chef is commonly used with Amazon AWS EC2 nodes. This sub-command will generate instance metadata that can be used to automatically configure an EC2 instance with Chef. This requires an AMI that has Chef preinstalled with a configuration file that can parse the metadata at run-time. At this time this is the only sub-command for EC2, but more may be added later similar to __RACKSPACE__ and __TERREMARK__ below.
|
390
|
+
|
391
|
+
__ec2 instance data [RUN LIST...]__ _(options)_
|
392
|
+
|
393
|
+
* `-e`, `--edit`:
|
394
|
+
Edit the instance data
|
395
|
+
|
396
|
+
The _RUN LIST_ should be specified as a space separated list of roles or recipes that will be used by the instance to configure the server.
|
397
|
+
|
398
|
+
## RACKSPACE SUB-COMMANDS
|
399
|
+
|
400
|
+
In addition to EC2 nodes, Chef can be used on Rackspace Cloud nodes. The following sub-commands allow manipulating Rackspace Cloud nodes via the `fog` library.
|
401
|
+
|
402
|
+
__rackspace server create [RUN LIST...]__ _(options)_
|
403
|
+
|
404
|
+
* `-K`, `--rackspace-api-key KEY`:
|
405
|
+
Your rackspace API key
|
406
|
+
* `-A USERNAME`, `--rackspace-api-username`:
|
407
|
+
Your rackspace API username
|
408
|
+
* `-f`, `--flavor FLAVOR `:
|
409
|
+
The flavor of server
|
410
|
+
* `-i`, `--image IMAGE `:
|
411
|
+
The image of the server
|
412
|
+
* `-N`, `--server-name NAME`:
|
413
|
+
The server name
|
414
|
+
|
415
|
+
Creates a new Rackspace Cloud server.
|
416
|
+
|
417
|
+
__rackspace server delete SERVER__ _(options)_
|
418
|
+
|
419
|
+
Deletes a running Rackspace Cloud server.
|
420
|
+
|
421
|
+
__rackspace server list__ _(options)_
|
422
|
+
|
423
|
+
Lists running Rackspace Cloud servers.
|
424
|
+
|
425
|
+
## TERREMARK SUB-COMMANDS
|
426
|
+
|
427
|
+
As above, Chef can also be used on Terremark vCloud nodes. The following sub-commands allow manipulating Terremark vCloud nodes via the `fog` library.
|
428
|
+
|
429
|
+
__terremark server create NAME [RUN LIST...]__ _(options)_
|
430
|
+
|
431
|
+
* `-K PASSWORD`, `--terremark-password`:
|
432
|
+
Your terremark password
|
433
|
+
* `-S`, `--terremark-service SERVICE`:
|
434
|
+
Your terremark service name
|
435
|
+
* `-A USERNAME`, `--terremark-username`:
|
436
|
+
Your terremark username
|
437
|
+
|
438
|
+
Creates a new Terremark vCloud server.
|
439
|
+
|
440
|
+
__terremark server delete SERVER__ _(options)_
|
441
|
+
|
442
|
+
Deletes a running Terremark vCloud server.
|
443
|
+
|
444
|
+
__terremark server list__ _(options)_
|
445
|
+
|
446
|
+
* `-K PASSWORD`, `--terremark-password`:
|
447
|
+
Your terremark password
|
448
|
+
* `-S`, `--terremark-service SERVICE`:
|
449
|
+
Your terremark service name
|
450
|
+
* `-A USERNAME`, `--terremark-username`:
|
451
|
+
Your terremark username
|
452
|
+
|
453
|
+
Lists running Terremark vCloud servers.
|
454
|
+
|
455
|
+
## CONFIGURATION
|
456
|
+
|
457
|
+
The knife configuration file is a Ruby DSL. If it exists, knife uses these settings for __GENERAL OPTIONS__ defaults.
|
458
|
+
|
459
|
+
`log_level`
|
460
|
+
|
461
|
+
A Ruby symbol specifying the log level. Corresponds to `-l` or `--log_level` option. Default is _:info_. Valid values are:
|
462
|
+
|
463
|
+
* :info
|
464
|
+
* :debug
|
465
|
+
* :warn
|
466
|
+
* :fatal
|
467
|
+
|
468
|
+
`log_location`
|
469
|
+
|
470
|
+
Corresponds to the `-L` or `--log-file` option. Defaults is __STDOUT__. Valid values are __STDOUT__ or a filename.
|
471
|
+
|
472
|
+
`node_name`
|
473
|
+
|
474
|
+
User to authenticate to the Chef server. Corresponds to the `-u` or `--user` option. This is requested from the user when running this sub-command.
|
475
|
+
|
476
|
+
`client_key`
|
477
|
+
|
478
|
+
Private key file to authenticate to the Chef server. Corresponds to the `-k` or `--key` option. This is requested from the user when running this sub-command.
|
479
|
+
|
480
|
+
`chef_server_url`
|
481
|
+
|
482
|
+
URL of the Chef server. Corresponds to the `-s` or `--server-url` option. This is requested from the user when running this sub-command.
|
483
|
+
|
484
|
+
`cache_type`
|
485
|
+
|
486
|
+
The type of cache to use. Default is BasicFile. This can be any type of Cache that moneta supports: BasicFile, Berkeley, Couch, DataMapper, File, LMC, Memcache, Memory, MongoDB, Redis, Rufus, S3, SDBM, Tyrant, Xattr, YAML.
|
487
|
+
|
488
|
+
`cache_options`
|
489
|
+
|
490
|
+
Specifies various options to use for caching. Default reads the Chef client configuration (/etc/chef/checksums).
|
491
|
+
|
492
|
+
`validation_client_name`
|
493
|
+
|
494
|
+
Specifies the name of the client used to validate new clients. This is requested from the user when running the configuration sub-command.
|
495
|
+
|
496
|
+
`validation_key`
|
497
|
+
|
498
|
+
Specifies the private key file to use for generating ec2 instance data for validating new clients. This is implied from the `validation_client_name`.
|
499
|
+
|
500
|
+
## FILES
|
501
|
+
|
502
|
+
_~/.chef/knife.rb_
|
503
|
+
|
504
|
+
Ruby DSL configuration file for knife. See "__CONFIGURATION__".
|
505
|
+
|
506
|
+
## SEE ALSO
|
507
|
+
|
508
|
+
Full documentation for Chef is located on the Chef wiki, http://wiki.opscode.com/display/chef/Home/.
|
509
|
+
|
510
|
+
JSON is JavaScript Object Notation and more information can be found at http://json.org/.
|
511
|
+
|
512
|
+
SOLR is an open source search engine. The Chef Server includes a SOLR installation. More information about SOLR, including the search query syntax, can be found at http://lucene.apache.org/solr/.
|
513
|
+
|
514
|
+
This manual page was generated in nroff from Markdown with ronn. Ryan Tomayko wrote ronn and more information can be found at http://rtomayko.github.com/ronn/ronn.5.html.
|
515
|
+
|
516
|
+
## AUTHOR
|
517
|
+
|
518
|
+
Chef was written by Adam Jacob <adam@opscode.com> of Opscode (http://www.opscode.com), with contributions from the community. This manual page was written by Joshua Timberman <joshua@opscode.com>. Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
|
519
|
+
|
520
|
+
On Debian systems, the complete text of the Apache 2.0 License can be found in `/usr/share/common-licenses/Apache-2.0`.
|