Skip to content

Commit 6909e47

Browse files
committed
split knife manpages into separate categories
1 parent f5b41b2 commit 6909e47

18 files changed

Lines changed: 631 additions & 660 deletions
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
knife-bootrap(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __bootstrap__ _(options)_
7+
8+
* `-i`, `--identity-file IDENTITY_FILE`:
9+
The SSH identity file used for authentication
10+
* `-N`, `--node-name NAME`:
11+
The Chef node name for your new node
12+
* `-P`, `--ssh-password PASSWORD`:
13+
The ssh password
14+
* `-x`, `--ssh-user USERNAME`:
15+
The ssh username
16+
* `--prerelease`:
17+
Install pre-release Chef gems
18+
* `-r`, `--run-list RUN_LIST`:
19+
Comma separated list of roles/recipes to apply
20+
* `-P`, `--ssh-password PASSWORD`:
21+
The ssh password
22+
* `-x`, `--ssh-user USERNAME`:
23+
The ssh username
24+
* `--template-file TEMPLATE`:
25+
Full path to location of template to use
26+
* `--sudo`:
27+
Execute the bootstrap via sudo
28+
* `-d`, `--distro DISTRO`:
29+
Bootstrap a distro using a template
30+
31+
Performs a Chef Bootstrap on the target node. The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists. This sub-command is used internally by some cloud computing server create commands and the others will be migrated in a future version of Chef.
32+
33+
As of Chef 0.9.8, the bootstrap sub-command supports supplying a template to perform the bootstrap steps. If the distro is not specified (via `-d` or `--distro` option), an Ubuntu 10.04 with RubyGems is assumed. The __DISTRO__ value corresponds to the base filename of the template, in other words `DISTRO`.erb. A template file can be specified with the `--template-file` option in which case the __DISTRO__ is not used. The sub-command looks in the following locations for the template to use:
34+
35+
* `bootstrap` directory in the installed Chef Knife library.
36+
* `bootstrap` directory in the `$PWD/.chef`.
37+
* `bootstrap` directory in the users `$HOME/.chef`.
38+
39+
The default bootstrap templates are scripts that get copied to the target node (FQDN). As of Chef 0.9.8, the following distros are supported:
40+
41+
* centos5-gems
42+
* fedora13-gems
43+
* ubuntu10.04-gems
44+
* ubuntu10.04-apt
45+
46+
The gems installations will use RubyGems 1.3.6 and Chef installed as a gem. The apt installation will use the Opscode APT repository. The RubyGems installation requires installing gems with native extensions, so development related packages (ruby-dev, build-essential) are installed. These are not installed with the apt installation, as native extensions are already compiled in the required packages.
47+
48+
In addition to handling the software installation, these bootstrap templates do the following:
49+
50+
- Write the validation.pem per the local knife configuration.
51+
- Write a default config file for Chef (`/etc/chef/client.rb`) using values from the `knife.rb`.
52+
- Create a JSON attributes file containing the specified run list and run Chef.
53+
54+
In the case of the RubyGems, the `client.rb` will be written from scratch with a minimal set of values; see __EXAMPLES__. In the case of APT Package installation, `client.rb` will have the `validation_client_name` appended if it is not set to `chef-validator` (default config value), and the `node_name` will be added if `chef_node_name` option is specified.
55+
56+
When this is complete, the bootstrapped node will have:
57+
58+
- Latest Chef version installed from RubyGems or APT Packages from Opscode. This may be a later version than the local system.
59+
- Be validated with the configured Chef Server.
60+
- Have run Chef with its default run list if one is specfied.
61+
62+
Additional custom bootstrap templates can be created and stored in `.chef/bootstrap/DISTRO.erb`, replacing __DISTRO__ with the value passed with the `-d` or `--distro` option. See __EXAMPLES__ for more information.
63+
64+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
knife-client(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __client__ _sub-command_ _(options)_
7+
8+
## CLIENT SUB-COMMANDS
9+
10+
Clients are entities that communicate with the Chef Server API.
11+
12+
__client bulk delete REGEX__ _(options)_
13+
14+
Delete clients on the Chef Server based on a regular expression. The regular expression (_REGEX_) should be in quotes, not in //'s.
15+
16+
__client create CLIENT__ _(options)_
17+
18+
* `-a`, `--admin `:
19+
Create the client as an admin
20+
* `-f`, `--file FILE`:
21+
Write the key to a file
22+
23+
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`.
24+
25+
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.
26+
27+
__client delete CLIENT__ _(options)_
28+
29+
Deletes a registered client.
30+
31+
__client edit CLIENT__ _(options)_
32+
33+
Edit a registered client.
34+
35+
__client list__ _(options)_
36+
37+
* `-w`, `--with-uri`:
38+
Show corresponding URIs
39+
40+
List all registered clients.
41+
42+
__client reregister CLIENT__ _(options)_
43+
44+
* `-f`, `--file FILE`:
45+
Write the key to a file
46+
47+
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.
48+
49+
__client show CLIENT__ _(options)_
50+
51+
* `-a`, `--attribute ATTR`:
52+
Show only one attribute
53+
54+
Show a client.
55+
56+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
knife-configure(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __configure__ [client] _(options)_
7+
8+
## CONFIGURE SUBCOMMANDS ##
9+
10+
__configure__ _(options)_
11+
12+
* `-i`, `--initial`:
13+
Create an initial API Client
14+
* `-r`, `--repository REPO`:
15+
The path to your chef-repo
16+
17+
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.
18+
19+
__configure client DIRECTORY__
20+
21+
Read the `knife.rb` config file and generate a config file suitable for use in `/etc/chef/client.rb` and copy the validation certificate into the specified _DIRECTORY_.
22+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
knife-cookbook-site(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __cookbook site__ _sub-command_ _(options)_
7+
8+
## COOKBOOK SITE SUB-COMMANDS
9+
10+
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.
11+
12+
__cookbook site download COOKBOOK [VERSION]__ _(options)_
13+
14+
* `-f`, `--file FILE`:
15+
The filename to write to
16+
17+
Downloads a specific cookbook from the Community site, optionally specifying a certain version.
18+
19+
__cookbook site list__ _(options)_
20+
21+
* `-w`, `--with-uri`:
22+
Show corresponding URIs
23+
24+
Lists available cookbooks from the Community site.
25+
26+
__cookbook site search QUERY__ _(options)_
27+
28+
Searches the Community site with the specified query.
29+
30+
__cookbook site share COOKBOOK CATEGORY__ _(options)_
31+
32+
* `-k`, `--key KEY`:
33+
API Client Key
34+
* `-u`, `--user USER`:
35+
API Client Username
36+
* `-o`, `--cookbook-path PATH:PATH`:
37+
A colon-separated path to look for cookbooks in
38+
39+
Uploads the specified cookbook using the given category to the Opscode cookbooks site. Requires a login user and certificate for the Opscode Cookbooks site. See __EXAMPLES__ for usage if the Opscode user and certificate pair are not used for authenticating with the Chef Server. In other words, if the Chef Server is not the Opscode Platform.
40+
41+
__cookbook site unshare COOKBOOK__
42+
43+
Stops sharing the specified cookbook on the Opscode cookbooks site.
44+
45+
__cookbook site show COOKBOOK [VERSION]__ _(options)_
46+
47+
Shows information from the site about a particular cookbook.
48+
49+
__cookbook site vendor COOKBOOK [VERSION]__ _(options)_
50+
51+
* `-d`, `--dependencies`:
52+
Grab dependencies automatically
53+
54+
Uses `git` version control in conjunction with the cookbook site to download upstream cookbooks. A new vendor branch is created in git, the cookbook downloaded from the site and untarred, then the master branch is merged. This allows the user to track upstream changes to cookbooks while merging in customizations. If _-d_ is specified, all the cookbooks it depends on (via metadata _dependencies_) are downloaded and untarred as well, each using their own vendor branch.
55+
56+
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
knife-cookbook(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __cookbook__ _sub-command_ _(options)_
7+
8+
## COOKBOOK SUB-COMMANDS
9+
10+
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.
11+
12+
__cookbook bulk delete REGEX__ _(options)_
13+
14+
* `-p`, `--purge`:
15+
Purge files from backing store. This will disable any cookbook that contains any of the same files as the cookbook being purged.
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.
46+
47+
Specify `-C` or `--copyright` with the name of the copyright holder as your name or your company/organization name in a quoted string. If this value is not specified an all-caps string `YOUR_COMPANY_NAME` is used which can be easily changed with find/replace.
48+
49+
Specify `-I` or `--license` with the license that the cookbook is distributed under for sharing with other people or posting to the Opscode Cookbooks site. Be aware of the licenses of files you put inside the cookbook and follow any restrictions they describe. When using `none` (default) or `apachev2`, comment header text and metadata file are pre-filled. The `none` license will be treated as non-redistributable.
50+
51+
Specify `-E` or `--email` with the email address of the cookbook's maintainer. If this value is not specified, an all-caps string `YOUR_EMAIL` is used which can easily be changed with find/replace.
52+
53+
The cookbook copyright, license and email settings can be filled in the `knife.rb`, for example with default values:
54+
55+
cookbook_copyright "YOUR_COMPANY_NAME"
56+
cookbook_license "none"
57+
cookbook_email "YOUR_EMAIL"
58+
59+
__cookbook delete COOKBOOK [VERSION]__ _(options)_
60+
61+
* `-a`, `--all`:
62+
Delete all versions
63+
* `-p`, `--purge`:
64+
Purge files from backing store. This will disable any cookbook that contains any of the same files as the cookbook being purged.
65+
66+
Delete the specified _VERSION_ of the named _COOKBOOK_. If no version is specified, and only one version exists on the server, that version will be deleted. If multiple versions are available on the server, you will be prompted for a version to delete.
67+
68+
__cookbook download COOKBOOK [VERSION]__ _(options)_
69+
70+
* `-d`, `--dir DOWNLOAD_DIRECTORY`:
71+
The directory to download the cookbook into
72+
* `-f`, `--force`:
73+
Overwrite an existing directory with the download
74+
* `-N`, `--latest`:
75+
Download the latest version of the cookbook
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)_
80+
81+
* `-w`, `--with-uri`:
82+
Show corresponding URIs
83+
84+
List all the cookbooks.
85+
86+
__cookbook metadata COOKBOOK__ _(options)_
87+
88+
* `-a`, `--all`:
89+
Generate metadata for all cookbooks, rather than just a single cookbook
90+
* `-o`, `--cookbook-path PATH:PATH`:
91+
A colon-separated path to look for cookbooks in
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.
94+
95+
__cookbook metadata from FILE__ _(options)_
96+
97+
Load the cookbook metadata from a specified file.
98+
99+
__cookbook show COOKBOOK [VERSION] [PART] [FILENAME]__ _(options)_
100+
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+
108+
Show a particular part of a _COOKBOOK_ for the specified _VERSION_. _PART_ can be one of:
109+
110+
* _attributes_
111+
* _definitions_
112+
* _files_
113+
* _libraries_
114+
* _providers_
115+
* _recipes_
116+
* _resources_
117+
* _templates_
118+
119+
__cookbook test [COOKBOOKS...]__ _(options)_
120+
121+
* `-a`, `--all`:
122+
Test all cookbooks, rather than just a single cookbook
123+
* `-o`, `--cookbook-path PATH:PATH`:
124+
A colon-separated path to look for cookbooks in
125+
126+
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).
127+
128+
__cookbook upload [COOKBOOKS...]__ _(options)_
129+
130+
* `-a`, `--all`:
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
134+
135+
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.
136+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
knife-data-bag(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __data bag__ _sub-command_ _(options)_
7+
8+
## DATA BAG SUB-COMMANDS
9+
10+
Data bags are stores of JSON blobs. These blobs are called items. They are free form JSON and indexed by the Chef Server.
11+
12+
__data bag create BAG [ITEM]__ _(options)_
13+
14+
Create a new data bag, or an item in a data bag.
15+
16+
__data bag delete BAG [ITEM]__ _(options)_
17+
18+
Delete a data bag, or an item from a data bag.
19+
20+
__data bag edit BAG ITEM__ _(options)_
21+
22+
Edit an item in a data bag.
23+
24+
__data bag from file BAG FILE__ _(options)_
25+
26+
Load a data bag item from a JSON file. Looks in the directory `data_bags/BAG/ITEM.json` unless a relative path is specified.
27+
28+
__data bag list__ _(options)_
29+
30+
* `-w`, `--with-uri`:
31+
Show corresponding URIs
32+
33+
List the available data bags.
34+
35+
__data bag show BAG [ITEM]__ _(options)_
36+
37+
Show a specific data bag or an item in a data bag.
38+
39+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
knife-environment(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __environment__ _sub-command_ _(options)_
7+
8+
## ENVIRONMENT SUBCOMMANDS
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
knife-exec(8) -- Chef Server REST API utility
2+
========================================
3+
4+
## SYNOPSIS
5+
6+
__knife__ __exec__ _(options)_
7+
8+
## EXEC SUBCOMMAND
9+

0 commit comments

Comments
 (0)