From 24dc69a9a97e82a6e4207de68d6dcc664178249b Mon Sep 17 00:00:00 2001 From: Seth Chisamore Date: Tue, 30 Oct 2012 10:39:35 -0400 Subject: [OC-3564] move core Chef to the repo root \o/ \m/ The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo! --- distro/common/html/chef-shell.1.html | 286 +++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 distro/common/html/chef-shell.1.html (limited to 'distro/common/html/chef-shell.1.html') diff --git a/distro/common/html/chef-shell.1.html b/distro/common/html/chef-shell.1.html new file mode 100644 index 0000000000..195870cc53 --- /dev/null +++ b/distro/common/html/chef-shell.1.html @@ -0,0 +1,286 @@ + + + + + + chef-shell(1) - Interactive Chef Console + + + + + +
+ + + +
    +
  1. chef-shell(1)
  2. +
  3. Chef Manual
  4. +
  5. chef-shell(1)
  6. +
+ +

NAME

+

+ chef-shell - Interactive Chef Console +

+ +

SYNOPSIS

+ +

chef-shell [named configuration] (options)

+ +
+
-S, --server CHEF_SERVER_URL
The chef server URL
+
-z, --client
chef-client mode
+
-c, --config CONFIG
The configuration file to use
+
-j, --json-attributes JSON_ATTRIBS
Load attributes from a JSON file or URL
+
-l, --log-level LOG_LEVEL
Set the logging level
+
-s, --solo
chef-solo session
+
-a, --standalone
standalone session
+
-v, --version
Show chef version
+
-h, --help
Show command options
+
+ + +

When no --config option is specified, chef-shell attempts to load a +default configuration file:

+ + + + +

DESCRIPTION

+ +

chef-shell is an irb(1) (interactive ruby) session customized for Chef. +chef-shell serves two primary functions: it provides a means to +interact with a Chef Server interactively using a convenient DSL; it +allows you to define and run Chef recipes interactively.

+ +

SYNTAX

+ +

chef-shell uses irb's subsession feature to provide multiple modes of +interaction. In addition to the primary mode which is entered on start, +recipe and attributes modes are available.

+ +

PRIMARY MODE

+ +

The following commands are available in the primary +session:

+ +
+
help
Prints a list of available commands
+
version
Prints the Chef version
+
recipe
Switches to recipe mode
+
attributes
Switches to attributes mode
+
run_chef
Initiates a chef run
+
reset
reinitializes chef-shell session
+
echo :on|:off
Turns irb's echo function on or off. Echo is on by default.
+
tracing :on|:off
Turns irb's function tracing feature on or off. Tracing is extremely +verbose and expected to be of interest primarily to developers.
+
node
Returns the node object for the current host. See knife-node(1) +for more information about nodes.
+
ohai
Prints the attributes of node
+
+ + +

In addition to these commands, chef-shell provides a DSL for accessing +data on the Chef Server. When working with remote data in chef-shell, you +chain method calls in the form object type.operation, where +object type is in plural form. The following object types are +available:

+ + + + +

For each object type the following operations are available:

+ +
+
object type.all(&block)
Loads all items from the server. If the optional code block is +given, each item will be passed to the block and the results +returned, similar to ruby's Enumerable#map method.
+
object type.show(object name)

Aliased as object type.load

+ +

Loads the singular item identified by object name.

+
object type.search(query, &block)

Aliased as object type.find

+ +

Runs a search against the server and returns the matching items. If +the optional code block is given each item will be passed to the +block and the results returned.

+ +

The query may be a Solr/Lucene format query given as a String, or +a Hash of conditions. If a Hash is given, the options will be ANDed +together. To join conditions with OR, use negative queries, or any +advanced search syntax, you must provide give the query in String +form.

+
object type.transform(:all|query, &block)

Aliased as object type.bulk_edit

+ +

Bulk edit objects by processing them with the (required) code block. +You can edit all objects of the given type by passing the Symbol +:all as the argument, or only a subset by passing a query as the +argument. The query is evaluated in the same way as with +search.

+ +

The return value of the code block is used to alter the behavior +of transform. If the value returned from the block is nil or +false, the object will not be saved. Otherwise, the object is +saved after being passed to the block. This behavior can be +exploited to create a dry run to test a data transformation.

+
+ + +

RECIPE MODE

+ +

Recipe mode implements Chef's recipe DSL. Exhaustively documenting this +DSL is outside the scope of this document. See the following pages in +the Chef documentation for more information:

+ + + + +

Once you have defined resources in the recipe, you can trigger a +convergence run via run_chef

+ +

EXAMPLES

+ + + + +

BUGS

+ +

chef-shell often does not perfectly replicate the context in which +chef-client(8) configures a host, which may lead to discrepancies in +observed behavior.

+ +

chef-shell has to duplicate much code from chef-client's internal +libraries and may become out of sync with the behavior of those +libraries.

+ +

SEE ALSO

+ +

chef-client(8) knife(1) + http://wiki.opscode.com/display/chef/Chef+Shell

+ +

AUTHOR

+ +

Chef was written by Adam Jacob adam@opscode.com with many + contributions from the community. chef-shell was written by Daniel + DeLeo.

+ +

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

+ +

chef-shell is distributed with Chef. http://wiki.opscode.com/display/chef/Home

+ + +
    +
  1. Chef 11.0.0.alpha
  2. +
  3. September 2012
  4. +
  5. chef-shell(1)
  6. +
+ +
+ + -- cgit v1.2.1