summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2011-04-09 11:03:36 -0700
committerDaniel DeLeo <dan@opscode.com>2011-04-09 11:03:36 -0700
commit6c14edd337323f77aa36c987ee372a5c739c6c5b (patch)
treeafe4bb38339fcc32c542a143727c326c81f1b9fc
parentb1c8b22a11ccaa0676919ede7c25ff51dd6719d6 (diff)
downloadchef-6c14edd337323f77aa36c987ee372a5c739c6c5b.tar.gz
[CHEF-2201] add manual for knife environment commands
-rw-r--r--chef/distro/common/html/knife-environment.1.html175
-rw-r--r--chef/distro/common/man/man1/knife-environment.1166
-rw-r--r--chef/distro/common/markdown/man1/knife-environment.mkd143
3 files changed, 480 insertions, 4 deletions
diff --git a/chef/distro/common/html/knife-environment.1.html b/chef/distro/common/html/knife-environment.1.html
index b71f9dbef2..42367da8db 100644
--- a/chef/distro/common/html/knife-environment.1.html
+++ b/chef/distro/common/html/knife-environment.1.html
@@ -61,7 +61,20 @@
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
- <a href="#ENVIRONMENT-SUBCOMMANDS">ENVIRONMENT SUBCOMMANDS</a>
+ <a href="#SUBCOMMANDS">SUBCOMMANDS</a>
+ <a href="#CREATE">CREATE</a>
+ <a href="#DELETE">DELETE</a>
+ <a href="#EDIT">EDIT</a>
+ <a href="#FROM-FILE">FROM FILE</a>
+ <a href="#LIST">LIST</a>
+ <a href="#SHOW">SHOW</a>
+ <a href="#DESCRIPTION">DESCRIPTION</a>
+ <a href="#SYNTAX">SYNTAX</a>
+ <a href="#FORMAT">FORMAT</a>
+ <a href="#SEE-ALSO">SEE ALSO</a>
+ <a href="#AUTHOR">AUTHOR</a>
+ <a href="#DOCUMENTATION">DOCUMENTATION</a>
+ <a href="#CHEF">CHEF</a>
</div>
<ol class='man-decor man-head man head'>
@@ -79,7 +92,165 @@
<p><strong>knife</strong> <strong>environment</strong> <em>sub-command</em> <em>(options)</em></p>
-<h2 id="ENVIRONMENT-SUBCOMMANDS">ENVIRONMENT SUBCOMMANDS</h2>
+<h2 id="SUBCOMMANDS">SUBCOMMANDS</h2>
+
+<h2 id="CREATE">CREATE</h2>
+
+<p><strong>knife environment create</strong> <em>environment</em> <em>(options)</em></p>
+
+<dl>
+<dt><code>-d</code>, <code>--description DESCRIPTION</code></dt><dd>The value of the description field.</dd>
+</dl>
+
+
+<p>Create a new environment object on the Chef Server. The envrionment will
+be opened in the text editor for editing prior to creation if the -n
+option is not present.</p>
+
+<h2 id="DELETE">DELETE</h2>
+
+<p><strong>knife environment delete</strong> <em>environment</em> <em>(options)</em></p>
+
+<p>Destroy an environment on the Chef Server. A prompt for confirmation
+will be displayed if the -y options is not given.</p>
+
+<h2 id="EDIT">EDIT</h2>
+
+<p><strong>knife environment edit</strong> <em>environment</em> <em>(options)</em></p>
+
+<p>Fetch <em>environment</em> and display it in the text editor for editing. The
+environment will be saved to the Chef Server when the editing session
+exits.</p>
+
+<h2 id="FROM-FILE">FROM FILE</h2>
+
+<p><strong>knife environment from file</strong> <em>file</em> <em>(options)</em></p>
+
+<p>Create or update an environment from the JSON or Ruby format <em>file</em>. See
+<strong>format</strong> for the proper format of this file.</p>
+
+<h2 id="LIST">LIST</h2>
+
+<p><strong>knife environment list</strong> <em>(options)</em>
+ * <code>-w</code>, <code>--with-uri</code>:</p>
+
+<pre><code>Show the resource URI for each environment
+</code></pre>
+
+<h2 id="SHOW">SHOW</h2>
+
+<p><strong>knife environment show</strong> <em>environment</em> <em>(options)</em></p>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p>Environments provide a means to apply policies to hosts in your
+infrastructure based on business function. For example, you may have a
+separate copy of your infrastructure called "dev" that runs the latest
+version of your application and should use the newest versions of your
+cookbooks when configuring systems, and a production instance of your
+infrastructure where you wish to update code and cookbooks in a more
+controlled fashion. In Chef, this function is implemented with
+<em>environments</em>.</p>
+
+<p>Environments contain two major components: a set of cookbook version
+constraints and environment attributes.</p>
+
+<h2 id="SYNTAX">SYNTAX</h2>
+
+<p>A cookbook version constraint is comprised of a <em>cookbook name</em> and a
+<em>version constraint</em>. The <em>cookbook name</em> is the name of a cookbook in
+your system, and the <em>version constraint</em> is a String describing the
+version(s) of that cookbook allowed in the environment. Only one
+<em>version constraint</em> is supported for a given <em>cookbook name</em>.</p>
+
+<p>The exact syntax used to define a cookbook version constraint varies
+depending on whether you use the JSON format or the Ruby format. In the
+JSON format, the cookbook version constraints for an environment are
+represented as a single JSON object, like this:</p>
+
+<pre><code>{"apache2": "&gt;= 1.5.0"}
+</code></pre>
+
+<p>In the Ruby format, the cookbook version contraints for an environment
+are represented as a Ruby Hash, like this:</p>
+
+<pre><code>{"apache2" =&gt; "&gt;= 1.5.0"}
+</code></pre>
+
+<p>A <em>version number</em> is a String comprised of two or three digits
+separated by a dot (.) character, or in other words, strings of the form
+"major.minor" or "major.minor.patch". "1.2" and "1.2.3" are examples of
+valid version numbers. Version numbers containing more than three digits
+or alphabetic characters are not supported.</p>
+
+<p>A <em>version constraint</em> String is composed of an <em>operator</em> and a
+<em>version number</em>. The following operators are available:</p>
+
+<dl>
+<dt><code>= VERSION</code></dt><dd>Equality. Only the exact version specified may be used.</dd>
+<dt><code>&gt; VERSION</code></dt><dd>Greater than. Only versions greater than <code>VERSION</code> may be used.</dd>
+<dt><code>&gt;= VERSION</code></dt><dd>Greater than or equal to. Only versions equal to VERSION or greater
+may be used.</dd>
+<dt><code>&lt; VERSION</code></dt><dd>Less than. Only versions less than VERSION may be used.</dd>
+<dt><code>&lt;= VERSION</code></dt><dd>Less than or equal to. Only versions lesser or equal to VERSION may
+be used.</dd>
+<dt><code>~&gt; VERSION</code></dt><dd>Pessimistic greater than. Depending on the number of components in
+the given VERSION, the constraint will be optimistic about future
+minor or patch revisions only. For example, <code>~&gt; 1.1</code> will match any
+version less than <code>2.0</code> and greater than or equal to <code>1.1.0</code>,
+whereas <code>~&gt; 2.0.5</code> will match any version less than <code>2.1.0</code> and
+greater than or equal to <code>2.0.5</code>.</dd>
+</dl>
+
+
+<h2 id="FORMAT">FORMAT</h2>
+
+<p>The JSON format of an envioronment is as follows:</p>
+
+<pre><code>{
+ "name": "dev",
+ "description": "The development environment",
+ "cookbook_versions": {
+ "couchdb": "= 11.0.0"
+ },
+ "json_class": "Chef::Environment",
+ "chef_type": "environment",
+ "default_attributes": {
+ "apache2": { "listen_ports": [ "80", "443" ] }
+ },
+ "override_attributes": {
+ "aws_s3_bucket": "production"
+ }
+}
+</code></pre>
+
+<p>The Ruby format of an environment is as follows:</p>
+
+<pre><code>name "dev"
+description "The development environment"
+cookbook_versions "couchdb" =&gt; "= 11.0.0"
+default_attributes "apache2" =&gt; { "listen_ports" =&gt; [ "80", "443" ] }
+override_attributes "aws_s3_bucket" =&gt; "production"
+</code></pre>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<p> <strong><span class="man-ref">knife-node<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-cookbook<span class="s">(1)</span></span></strong> <strong><span class="man-ref">knife-role<span class="s">(1)</span></span></strong>
+ <a href="http://wiki.opscode.com/display/chef/Environments" data-bare-link="true">http://wiki.opscode.com/display/chef/Environments</a>
+ <a href="http://wiki.opscode.com/display/chef/Version+Constraints" data-bare-link="true">http://wiki.opscode.com/display/chef/Version+Constraints</a></p>
+
+<h2 id="AUTHOR">AUTHOR</h2>
+
+<p> Chef was written by Adam Jacob <a href="&#x6d;&#97;&#105;&#x6c;&#116;&#111;&#x3a;&#97;&#100;&#97;&#x6d;&#x40;&#111;&#x70;&#115;&#x63;&#111;&#100;&#x65;&#x2e;&#99;&#111;&#109;" data-bare-link="true">&#x61;&#100;&#97;&#109;&#64;&#111;&#112;&#115;&#x63;&#x6f;&#x64;&#101;&#x2e;&#x63;&#x6f;&#x6d;</a> with many contributions from the community.</p>
+
+<h2 id="DOCUMENTATION">DOCUMENTATION</h2>
+
+<p> This manual page was written by Daniel DeLeo <a href="&#x6d;&#97;&#105;&#108;&#116;&#x6f;&#x3a;&#100;&#x61;&#x6e;&#x40;&#x6f;&#x70;&#115;&#x63;&#111;&#100;&#x65;&#x2e;&#99;&#111;&#x6d;" data-bare-link="true">&#x64;&#x61;&#110;&#64;&#111;&#112;&#x73;&#x63;&#x6f;&#x64;&#x65;&#46;&#x63;&#111;&#x6d;</a>.
+ Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.</p>
+
+<h2 id="CHEF">CHEF</h2>
+
+<p> Knife is distributed with Chef. <a href="http://wiki.opscode.com/display/chef/Home" data-bare-link="true">http://wiki.opscode.com/display/chef/Home</a></p>
<ol class='man-decor man-foot man foot'>
diff --git a/chef/distro/common/man/man1/knife-environment.1 b/chef/distro/common/man/man1/knife-environment.1
index 33f42c367e..386b520456 100644
--- a/chef/distro/common/man/man1/knife-environment.1
+++ b/chef/distro/common/man/man1/knife-environment.1
@@ -9,5 +9,169 @@
.SH "SYNOPSIS"
\fBknife\fR \fBenvironment\fR \fIsub\-command\fR \fI(options)\fR
.
-.SH "ENVIRONMENT SUBCOMMANDS"
+.SH "SUBCOMMANDS"
+.
+.SH "CREATE"
+\fBknife environment create\fR \fIenvironment\fR \fI(options)\fR
+.
+.TP
+\fB\-d\fR, \fB\-\-description DESCRIPTION\fR
+The value of the description field\.
+.
+.P
+Create a new environment object on the Chef Server\. The envrionment will be opened in the text editor for editing prior to creation if the \-n option is not present\.
+.
+.SH "DELETE"
+\fBknife environment delete\fR \fIenvironment\fR \fI(options)\fR
+.
+.P
+Destroy an environment on the Chef Server\. A prompt for confirmation will be displayed if the \-y options is not given\.
+.
+.SH "EDIT"
+\fBknife environment edit\fR \fIenvironment\fR \fI(options)\fR
+.
+.P
+Fetch \fIenvironment\fR and display it in the text editor for editing\. The environment will be saved to the Chef Server when the editing session exits\.
+.
+.SH "FROM FILE"
+\fBknife environment from file\fR \fIfile\fR \fI(options)\fR
+.
+.P
+Create or update an environment from the JSON or Ruby format \fIfile\fR\. See \fBformat\fR for the proper format of this file\.
+.
+.SH "LIST"
+\fBknife environment list\fR \fI(options)\fR * \fB\-w\fR, \fB\-\-with\-uri\fR:
+.
+.IP "" 4
+.
+.nf
+
+Show the resource URI for each environment
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SHOW"
+\fBknife environment show\fR \fIenvironment\fR \fI(options)\fR
+.
+.SH "DESCRIPTION"
+Environments provide a means to apply policies to hosts in your infrastructure based on business function\. For example, you may have a separate copy of your infrastructure called "dev" that runs the latest version of your application and should use the newest versions of your cookbooks when configuring systems, and a production instance of your infrastructure where you wish to update code and cookbooks in a more controlled fashion\. In Chef, this function is implemented with \fIenvironments\fR\.
+.
+.P
+Environments contain two major components: a set of cookbook version constraints and environment attributes\.
+.
+.SH "SYNTAX"
+A cookbook version constraint is comprised of a \fIcookbook name\fR and a \fIversion constraint\fR\. The \fIcookbook name\fR is the name of a cookbook in your system, and the \fIversion constraint\fR is a String describing the version(s) of that cookbook allowed in the environment\. Only one \fIversion constraint\fR is supported for a given \fIcookbook name\fR\.
+.
+.P
+The exact syntax used to define a cookbook version constraint varies depending on whether you use the JSON format or the Ruby format\. In the JSON format, the cookbook version constraints for an environment are represented as a single JSON object, like this:
+.
+.IP "" 4
+.
+.nf
+
+{"apache2": ">= 1\.5\.0"}
+.
+.fi
+.
+.IP "" 0
+.
+.P
+In the Ruby format, the cookbook version contraints for an environment are represented as a Ruby Hash, like this:
+.
+.IP "" 4
+.
+.nf
+{"apache2" => ">= 1\.5\.0"}
+.
+.fi
+.
+.IP "" 0
+.
+.P
+A \fIversion number\fR is a String comprised of two or three digits separated by a dot (\.) character, or in other words, strings of the form "major\.minor" or "major\.minor\.patch"\. "1\.2" and "1\.2\.3" are examples of valid version numbers\. Version numbers containing more than three digits or alphabetic characters are not supported\.
+.
+.P
+A \fIversion constraint\fR String is composed of an \fIoperator\fR and a \fIversion number\fR\. The following operators are available:
+.
+.TP
+\fB= VERSION\fR
+Equality\. Only the exact version specified may be used\.
+.
+.TP
+\fB> VERSION\fR
+Greater than\. Only versions greater than \fBVERSION\fR may be used\.
+.
+.TP
+\fB>= VERSION\fR
+Greater than or equal to\. Only versions equal to VERSION or greater may be used\.
+.
+.TP
+\fB< VERSION\fR
+Less than\. Only versions less than VERSION may be used\.
+.
+.TP
+\fB<= VERSION\fR
+Less than or equal to\. Only versions lesser or equal to VERSION may be used\.
+.
+.TP
+\fB~> VERSION\fR
+Pessimistic greater than\. Depending on the number of components in the given VERSION, the constraint will be optimistic about future minor or patch revisions only\. For example, \fB~> 1\.1\fR will match any version less than \fB2\.0\fR and greater than or equal to \fB1\.1\.0\fR, whereas \fB~> 2\.0\.5\fR will match any version less than \fB2\.1\.0\fR and greater than or equal to \fB2\.0\.5\fR\.
+.
+.SH "FORMAT"
+The JSON format of an envioronment is as follows:
+.
+.IP "" 4
+.
+.nf
+
+{
+ "name": "dev",
+ "description": "The development environment",
+ "cookbook_versions": {
+ "couchdb": "= 11\.0\.0"
+ },
+ "json_class": "Chef::Environment",
+ "chef_type": "environment",
+ "default_attributes": {
+ "apache2": { "listen_ports": [ "80", "443" ] }
+ },
+ "override_attributes": {
+ "aws_s3_bucket": "production"
+ }
+}
+.
+.fi
+.
+.IP "" 0
+.
+.P
+The Ruby format of an environment is as follows:
+.
+.IP "" 4
+.
+.nf
+
+name "dev"
+description "The development environment"
+cookbook_versions "couchdb" => "= 11\.0\.0"
+default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }
+override_attributes "aws_s3_bucket" => "production"
+.
+.fi
+.
+.IP "" 0
+.
+.SH "SEE ALSO"
+\fBknife\-node(1)\fR \fBknife\-cookbook(1)\fR \fBknife\-role(1)\fR \fIhttp://wiki\.opscode\.com/display/chef/Environments\fR \fIhttp://wiki\.opscode\.com/display/chef/Version+Constraints\fR
+.
+.SH "AUTHOR"
+Chef was written by Adam Jacob \fIadam@opscode\.com\fR with many contributions from the community\.
+.
+.SH "DOCUMENTATION"
+This manual page was written by Daniel DeLeo \fIdan@opscode\.com\fR\. Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2\.0 License\.
+.
+.SH "CHEF"
+Knife is distributed with Chef\. \fIhttp://wiki\.opscode\.com/display/chef/Home\fR
diff --git a/chef/distro/common/markdown/man1/knife-environment.mkd b/chef/distro/common/markdown/man1/knife-environment.mkd
index 9c17dd3465..7ee223f86d 100644
--- a/chef/distro/common/markdown/man1/knife-environment.mkd
+++ b/chef/distro/common/markdown/man1/knife-environment.mkd
@@ -5,4 +5,145 @@ knife-environment(1) -- Define cookbook policies for the environments in your in
__knife__ __environment__ _sub-command_ _(options)_
-## ENVIRONMENT SUBCOMMANDS
+## SUBCOMMANDS
+
+## CREATE
+__knife environment create__ _environment_ _(options)_
+
+ * `-d`, `--description DESCRIPTION`:
+ The value of the description field.
+
+Create a new environment object on the Chef Server. The envrionment will
+be opened in the text editor for editing prior to creation if the -n
+option is not present.
+
+## DELETE
+__knife environment delete__ _environment_ _(options)_
+
+Destroy an environment on the Chef Server. A prompt for confirmation
+will be displayed if the -y options is not given.
+
+## EDIT
+__knife environment edit__ _environment_ _(options)_
+
+Fetch _environment_ and display it in the text editor for editing. The
+environment will be saved to the Chef Server when the editing session
+exits.
+
+## FROM FILE
+__knife environment from file__ _file_ _(options)_
+
+Create or update an environment from the JSON or Ruby format _file_. See
+__format__ for the proper format of this file.
+
+## LIST
+__knife environment list__ _(options)_
+ * `-w`, `--with-uri`:
+ Show the resource URI for each environment
+
+## SHOW
+__knife environment show__ _environment_ _(options)_
+
+## DESCRIPTION
+Environments provide a means to apply policies to hosts in your
+infrastructure based on business function. For example, you may have a
+separate copy of your infrastructure called "dev" that runs the latest
+version of your application and should use the newest versions of your
+cookbooks when configuring systems, and a production instance of your
+infrastructure where you wish to update code and cookbooks in a more
+controlled fashion. In Chef, this function is implemented with
+_environments_.
+
+Environments contain two major components: a set of cookbook version
+constraints and environment attributes.
+
+## SYNTAX
+A cookbook version constraint is comprised of a _cookbook name_ and a
+_version constraint_. The _cookbook name_ is the name of a cookbook in
+your system, and the _version constraint_ is a String describing the
+version(s) of that cookbook allowed in the environment. Only one
+_version constraint_ is supported for a given _cookbook name_.
+
+The exact syntax used to define a cookbook version constraint varies
+depending on whether you use the JSON format or the Ruby format. In the
+JSON format, the cookbook version constraints for an environment are
+represented as a single JSON object, like this:
+
+ {"apache2": ">= 1.5.0"}
+
+In the Ruby format, the cookbook version contraints for an environment
+are represented as a Ruby Hash, like this:
+
+ {"apache2" => ">= 1.5.0"}
+
+A _version number_ is a String comprised of two or three digits
+separated by a dot (.) character, or in other words, strings of the form
+"major.minor" or "major.minor.patch". "1.2" and "1.2.3" are examples of
+valid version numbers. Version numbers containing more than three digits
+or alphabetic characters are not supported.
+
+A _version constraint_ String is composed of an _operator_ and a
+_version number_. The following operators are available:
+
+ * `= VERSION`:
+ Equality. Only the exact version specified may be used.
+ * `> VERSION`:
+ Greater than. Only versions greater than `VERSION` may be used.
+ * `>= VERSION`:
+ Greater than or equal to. Only versions equal to VERSION or greater
+ may be used.
+ * `< VERSION`:
+ Less than. Only versions less than VERSION may be used.
+ * `<= VERSION`:
+ Less than or equal to. Only versions lesser or equal to VERSION may
+ be used.
+ * `~> VERSION`:
+ Pessimistic greater than. Depending on the number of components in
+ the given VERSION, the constraint will be optimistic about future
+ minor or patch revisions only. For example, `~> 1.1` will match any
+ version less than `2.0` and greater than or equal to `1.1.0`,
+ whereas `~> 2.0.5` will match any version less than `2.1.0` and
+ greater than or equal to `2.0.5`.
+
+## FORMAT
+The JSON format of an envioronment is as follows:
+
+ {
+ "name": "dev",
+ "description": "The development environment",
+ "cookbook_versions": {
+ "couchdb": "= 11.0.0"
+ },
+ "json_class": "Chef::Environment",
+ "chef_type": "environment",
+ "default_attributes": {
+ "apache2": { "listen_ports": [ "80", "443" ] }
+ },
+ "override_attributes": {
+ "aws_s3_bucket": "production"
+ }
+ }
+
+The Ruby format of an environment is as follows:
+
+ name "dev"
+ description "The development environment"
+ cookbook_versions "couchdb" => "= 11.0.0"
+ default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }
+ override_attributes "aws_s3_bucket" => "production"
+
+
+## SEE ALSO
+ __knife-node(1)__ __knife-cookbook(1)__ __knife-role(1)__
+ <http://wiki.opscode.com/display/chef/Environments>
+ <http://wiki.opscode.com/display/chef/Version+Constraints>
+
+## AUTHOR
+ Chef was written by Adam Jacob <adam@opscode.com> with many contributions from the community.
+
+## DOCUMENTATION
+ This manual page was written by Daniel DeLeo <dan@opscode.com>.
+ Permission is granted to copy, distribute and / or modify this document under the terms of the Apache 2.0 License.
+
+## CHEF
+ Knife is distributed with Chef. <http://wiki.opscode.com/display/chef/Home>