diff options
Diffstat (limited to 'distro/common/html/knife_node.html')
-rw-r--r-- | distro/common/html/knife_node.html | 655 |
1 files changed, 655 insertions, 0 deletions
diff --git a/distro/common/html/knife_node.html b/distro/common/html/knife_node.html new file mode 100644 index 0000000000..68432cb509 --- /dev/null +++ b/distro/common/html/knife_node.html @@ -0,0 +1,655 @@ + + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife node — Knife Man Pages</title> + + <link rel="stylesheet" href="_static/chef.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + <link rel="top" title="Knife Man Pages" href="index.html" /> + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + <div class="related"> + <h3>Navigation</h3> + <ul> + <li><a href="http://docs.opscode.com/chef/knife.html" target="_products">Knife</a>•</li> + <li><a href="http://docs.opscode.com/chef/resources.html" target="_products">Resources</a>•</li> + <li><a href="http://docs.opscode.com/chef/dsl_recipe.html" target="_products">Recipe DSL</a>•</li> + <li><a href="http://docs.opscode.com/chef/lwrps_custom.html" target="_products">LWRPs</a>•</li> + <li><a href="http://docs.opscode.com/search.html">Search the Docs</a>•</li> + <li><a href="http://docs.opscode.com/">Home</a> »</li> + + </ul> + </div> + + <div class="sphinxsidebar"> + <div class="sphinxsidebarwrapper"> + <p class="logo"><a href="knife.html"> + <img class="logo" src="_static/chef_logo.png" alt="Logo"/> + </a></p> + <h3><a href="knife.html">Table Of Contents</a></h3> + <ul> +<li><a class="reference internal" href="#">knife node</a><ul> +<li><a class="reference internal" href="#bulk-delete">bulk delete</a><ul> +<li><a class="reference internal" href="#syntax">Syntax</a></li> +<li><a class="reference internal" href="#options">Options</a></li> +<li><a class="reference internal" href="#examples">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#create">create</a><ul> +<li><a class="reference internal" href="#id1">Syntax</a></li> +<li><a class="reference internal" href="#id2">Options</a></li> +<li><a class="reference internal" href="#id3">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#delete">delete</a><ul> +<li><a class="reference internal" href="#id4">Syntax</a></li> +<li><a class="reference internal" href="#id5">Options</a></li> +<li><a class="reference internal" href="#id6">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#edit">edit</a><ul> +<li><a class="reference internal" href="#id7">Syntax</a></li> +<li><a class="reference internal" href="#id8">Options</a></li> +<li><a class="reference internal" href="#id9">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#from-file">from file</a><ul> +<li><a class="reference internal" href="#id10">Syntax</a></li> +<li><a class="reference internal" href="#id11">Options</a><ul> +<li><a class="reference internal" href="#knife-rb-settings">knife.rb Settings</a></li> +</ul> +</li> +<li><a class="reference internal" href="#id12">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#list">list</a><ul> +<li><a class="reference internal" href="#id13">Syntax</a></li> +<li><a class="reference internal" href="#id14">Options</a><ul> +<li><a class="reference internal" href="#id15">knife.rb Settings</a></li> +</ul> +</li> +<li><a class="reference internal" href="#id16">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#run-list-add">run_list add</a><ul> +<li><a class="reference internal" href="#id17">Syntax</a></li> +<li><a class="reference internal" href="#id18">Options</a><ul> +<li><a class="reference internal" href="#id19">knife.rb Settings</a></li> +</ul> +</li> +<li><a class="reference internal" href="#id20">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#run-list-remove">run_list remove</a><ul> +<li><a class="reference internal" href="#id21">Syntax</a></li> +<li><a class="reference internal" href="#id22">Options</a><ul> +<li><a class="reference internal" href="#id23">knife.rb Settings</a></li> +</ul> +</li> +<li><a class="reference internal" href="#id24">Examples</a></li> +</ul> +</li> +<li><a class="reference internal" href="#show">show</a><ul> +<li><a class="reference internal" href="#id25">Syntax</a></li> +<li><a class="reference internal" href="#id26">Options</a></li> +<li><a class="reference internal" href="#id27">Examples</a></li> +</ul> +</li> +</ul> +</li> +</ul> + + </div> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body"> + + <div class="section" id="knife-node"> +<h1>knife node<a class="headerlink" href="#knife-node" title="Permalink to this headline">¶</a></h1> +<p>A node is any physical, virtual, or cloud machine that is configured to be maintained by a chef-client.</p> +<p>The <strong>knife node</strong> subcommand is used to manage the nodes that exist on a server.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<div class="section" id="bulk-delete"> +<h2>bulk delete<a class="headerlink" href="#bulk-delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">bulk</span> <span class="pre">delete</span></tt> argument is used to delete one or more nodes that match a pattern defined by a regular expression. The regular expression must be within quotes and not be surrounded by forward slashes (/).</p> +<div class="section" id="syntax"> +<h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node bulk delete REGEX +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h3>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="examples"> +<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Bulk delete nodes</strong></p> +<p>Use a regular expression to define the pattern used to bulk delete nodes:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node bulk delete <span class="s2">"^[0-9]{3}$"</span> +</pre></div> +</div> +<p>Type <tt class="docutils literal"><span class="pre">Y</span></tt> to confirm a deletion.</p> +</div> +</div> +<div class="section" id="create"> +<h2>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">create</span></tt> argument is used to add a node to the server. Node data is stored as JSON on the server.</p> +<div class="section" id="id1"> +<h3>Syntax<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node create NODE_NAME +</pre></div> +</div> +</div> +<div class="section" id="id2"> +<h3>Options<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id3"> +<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a node</strong></p> +<p>To add a node, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node create node1 +</pre></div> +</div> +<p>In the $EDITOR enter the node data in JSON:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "normal": { + }, + "name": "foobar", + "override": { + }, + "default": { + }, + "json_class": "Chef::Node", + "automatic": { + }, + "run_list": [ + "recipe[zsh]", + "role[webserver]" + ], + "chef_type": "node" +}</pre> +</div> +<p>When finished, save it.</p> +</div> +</div> +<div class="section" id="delete"> +<h2>delete<a class="headerlink" href="#delete" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">delete</span></tt> argument is used to delete a node from the server.</p> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Deleting a node will not delete any corresponding API clients.</p> +</div> +<div class="section" id="id4"> +<h3>Syntax<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node delete NODE_NAME +</pre></div> +</div> +</div> +<div class="section" id="id5"> +<h3>Options<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +</div> +<div class="section" id="id6"> +<h3>Examples<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Delete a node</strong></p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node delete node_name +</pre></div> +</div> +</div> +</div> +<div class="section" id="edit"> +<h2>edit<a class="headerlink" href="#edit" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">edit</span></tt> argument is used to edit the details of a node on a server. Node data is stored as JSON on the server.</p> +<div class="section" id="id7"> +<h3>Syntax<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node edit NODE_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id8"> +<h3>Options<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt> +<dd>Displays a node in the $EDITOR. By default, attributes that are default, override, or automatic are not shown.</dd> +</dl> +</div> +<div class="section" id="id9"> +<h3>Examples<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Edit a node</strong></p> +<p>To edit the data for a node named “node1”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node edit node1 -a +</pre></div> +</div> +<p>Update the role data in JSON:</p> +<div class="highlight-javascript"><pre>## sample: +{ + "normal": { + }, + "name": "node1", + "override": { + }, + "default": { + }, + "json_class": "Chef::Node", + "automatic": { + }, + "run_list": [ + "recipe[devops]", + "role[webserver]" + ], + "chef_type": "node" +}</pre> +</div> +<p>When finished, save it.</p> +</div> +</div> +<div class="section" id="from-file"> +<h2>from file<a class="headerlink" href="#from-file" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">from</span> <span class="pre">file</span></tt> argument is used to create a node using existing node data as a template.</p> +<div class="section" id="id10"> +<h3>Syntax<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node from file FILE +</pre></div> +</div> +</div> +<div class="section" id="id11"> +<h3>Options<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +<div class="section" id="knife-rb-settings"> +<h4>knife.rb Settings<a class="headerlink" href="#knife-rb-settings" title="Permalink to this headline">¶</a></h4> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p> +</div> +<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">from</span> <span class="pre">file</span></tt> settings can be added to the knife.rb file:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">knife[:print_after]</span></tt></dt> +<dd>Use to add the <tt class="docutils literal"><span class="pre">--print-after</span></tt> option.</dd> +</dl> +</div> +</div> +<div class="section" id="id12"> +<h3>Examples<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Create a node using a JSON file</strong></p> +<p>To add a node using data contained in a JSON file:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node from file <span class="s2">"path to JSON file"</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="list"> +<h2>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">list</span></tt> argument is used to view all of the nodes that exist on a server.</p> +<div class="section" id="id13"> +<h3>Syntax<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node list <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id14"> +<h3>Options<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-w</span></tt>, <tt class="docutils literal"><span class="pre">--with-uri</span></tt></dt> +<dd>Indicates that the corresponding URIs will be shown.</dd> +</dl> +<div class="section" id="id15"> +<h4>knife.rb Settings<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h4> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p> +</div> +<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">list</span></tt> settings can be added to the knife.rb file:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">knife[:environment]</span></tt></dt> +<dd>Use to add the <tt class="docutils literal"><span class="pre">--environment</span></tt> option.</dd> +</dl> +</div> +</div> +<div class="section" id="id16"> +<h3>Examples<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>View a list of nodes</strong></p> +<p>To verify the list of nodes that are registered with the server, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node list +</pre></div> +</div> +<p>to return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre>i-12345678 +rs-123456 +</pre></div> +</div> +</div> +</div> +<div class="section" id="run-list-add"> +<h2>run_list add<a class="headerlink" href="#run-list-add" title="Permalink to this headline">¶</a></h2> +<p>A run-list is an ordered list of roles and/or recipes that are run in an exact order. A run-list is always specific to the node on which it runs, though it is possible for many nodes to have run-lists that are similar or even identical. The items within a run-list are maintained using Knife and are uploaded to the server and stored as part of the node object for each node. The chef-client always configures a node in the exact order specified by its run-list and will never run the same recipe twice.</p> +<p>The <tt class="docutils literal"><span class="pre">run_list</span> <span class="pre">add</span></tt> argument is used to add run list items (roles or recipes) to a node.</p> +<p>A run-list must be in one of the following formats: fully qualified, cookbook, or default. Both roles and recipes must be in quotes, for example:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="s1">'role[ROLE_NAME]'</span> +</pre></div> +</div> +<p>or</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="s1">'recipe[COOKBOOK::RECIPE_NAME]'</span> +</pre></div> +</div> +<p>Use a comma to separate roles and recipes when adding more than one item the run-list:</p> +<div class="highlight-ruby"><div class="highlight"><pre><span class="s1">'recipe[COOKBOOK::RECIPE_NAME],COOKBOOK::RECIPE_NAME,role[ROLE_NAME]'</span> +</pre></div> +</div> +<div class="section" id="id17"> +<h3>Syntax<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add NODE_NAME RUN_LIST_ITEM <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id18"> +<h3>Options<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ITEM</span></tt>, <tt class="docutils literal"><span class="pre">--after</span> <span class="pre">ITEM</span></tt></dt> +<dd>Use this to add the run list item after the specified run list item.</dd> +</dl> +<div class="section" id="id19"> +<h4>knife.rb Settings<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h4> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p> +</div> +<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">run</span> <span class="pre">list</span> <span class="pre">add</span></tt> settings can be added to the knife.rb file:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">knife[:after]</span></tt></dt> +<dd>Use to add the <tt class="docutils literal"><span class="pre">--after</span></tt> option.</dd> +<dt><tt class="docutils literal"><span class="pre">knife[:run_list]</span></tt></dt> +<dd>Use for the run-list that is passed as part of a the command itself.</dd> +</dl> +</div> +</div> +<div class="section" id="id20"> +<h3>Examples<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Add a role</strong></p> +<p>To add a role to a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'role[ROLE_NAME]'</span> +</pre></div> +</div> +<p><strong>Add roles and recipes</strong></p> +<p>To add roles and recipes to a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'recipe[COOKBOOK::RECIPE_NAME],recipe[COOKBOOK::RECIPE_NAME],role[ROLE_NAME]'</span> +</pre></div> +</div> +<p><strong>Add a recipe with a FQDN</strong></p> +<p>To add a recipe to a run list using the fully qualified format, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'recipe[COOKBOOK::RECIPE_NAME]'</span> +</pre></div> +</div> +<p><strong>Add a recipe with a cookbook</strong></p> +<p>To add a recipe to a run list using the cookbook format, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'COOKBOOK::RECIPE_NAME'</span> +</pre></div> +</div> +<p><strong>Add the default recipe</strong></p> +<p>To add the default recipe of a cookbook to a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list add node <span class="s1">'COOKBOOK'</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="run-list-remove"> +<h2>run_list remove<a class="headerlink" href="#run-list-remove" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">run_list</span> <span class="pre">remove</span></tt> argument is used to remove run list items (roles or recipes) from a node. A recipe must be in one of the following formats: fully qualified, cookbook, or default. Both roles and recipes must be in quotes, for example: <tt class="docutils literal"><span class="pre">'role[ROLE_NAME]'</span></tt> or <tt class="docutils literal"><span class="pre">'recipe[COOKBOOK::RECIPE_NAME]'</span></tt>. Use a comma to separate roles and recipes when removing more than one, like this: <tt class="docutils literal"><span class="pre">'recipe[COOKBOOK::RECIPE_NAME],COOKBOOK::RECIPE_NAME,role[ROLE_NAME]'</span></tt>.</p> +<div class="section" id="id21"> +<h3>Syntax<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list remove NODE_NAME RUN_LIST_ITEM +</pre></div> +</div> +</div> +<div class="section" id="id22"> +<h3>Options<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3> +<p>This command does not have any specific options.</p> +<div class="section" id="id23"> +<h4>knife.rb Settings<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h4> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">See <tt class="xref doc docutils literal"><span class="pre">knife.rb</span></tt> for more information about how to add optional settings to the knife.rb file.</p> +</div> +<p>The following <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">run</span> <span class="pre">list</span> <span class="pre">remove</span></tt> settings can be added to the knife.rb file:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">knife[:run_list]</span></tt></dt> +<dd>Use for the run-list that is passed as part of a the command itself.</dd> +</dl> +</div> +</div> +<div class="section" id="id24"> +<h3>Examples<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Remove a role</strong></p> +<p>To remove a role from a run list, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list remove node <span class="s1">'role[ROLE_NAME]'</span> +</pre></div> +</div> +<p><strong>Remove a run-list</strong></p> +<p>To remove a recipe from a run list using the fully qualified format, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node run_list remove node <span class="s1">'recipe[COOKBOOK::RECIPE_NAME]'</span> +</pre></div> +</div> +</div> +</div> +<div class="section" id="show"> +<h2>show<a class="headerlink" href="#show" title="Permalink to this headline">¶</a></h2> +<p>The <tt class="docutils literal"><span class="pre">show</span></tt> argument is used to display information about a node.</p> +<div class="section" id="id25"> +<h3>Syntax<a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show NODE_NAME <span class="o">(</span>options<span class="o">)</span> +</pre></div> +</div> +</div> +<div class="section" id="id26"> +<h3>Options<a class="headerlink" href="#id26" title="Permalink to this headline">¶</a></h3> +<p>This argument has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt> +<dd>Display long output when searching nodes while using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt> +<dd>Display more, but not all, of a node’s data when searching using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span></tt></dt> +<dd>Indicates that only the run-list will be shown.</dd> +</dl> +</div> +<div class="section" id="id27"> +<h3>Examples<a class="headerlink" href="#id27" title="Permalink to this headline">¶</a></h3> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Show all data about nodes</strong></p> +<p>To view all data for a node named “build”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show build +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>Node Name: build +Environment: _default +FQDN: +IP: +Run List: +Roles: +Recipes: +Platform: +</pre></div> +</div> +<p><strong>Show basic information about nodes</strong></p> +<p>To show basic information about a node, truncated and nicely formatted:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show <node_name> +</pre></div> +</div> +<p><strong>Show all data about nodes, truncated</strong></p> +<p>To show all information about a node, nicely formatted:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l <node_name> +</pre></div> +</div> +<p><strong>Show attributes</strong></p> +<p>To list a single node attribute:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show <node_name> -a <attribute_name> +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre"><attribute_name></span></tt> is something like kernel or platform. (This doesn’t work for nested attributes like <tt class="docutils literal"><span class="pre">node[kernel][machine]</span></tt> because <tt class="docutils literal"><span class="pre">knife</span> <span class="pre">node</span> <span class="pre">show</span></tt> doesn’t understand nested attributes.)</p> +<p><strong>Show the FQDN</strong></p> +<p>To view the FQDN for a node named “i-12345678”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show i-12345678 -a fqdn +</pre></div> +</div> +<p>to return:</p> +<div class="highlight-bash"><div class="highlight"><pre>fqdn: ip-10-251-75-20.ec2.internal +</pre></div> +</div> +<p><strong>Show a run-list</strong></p> +<p>To view the run list for a node named “dev”, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife node show dev -r +</pre></div> +</div> +<p><strong>Show as JSON data</strong></p> +<p>To view information in JSON format, use the <tt class="docutils literal"><span class="pre">-F</span></tt> common option as part of the command like this:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife role show devops -F json +</pre></div> +</div> +<p>Other formats available include <tt class="docutils literal"><span class="pre">text</span></tt>, <tt class="docutils literal"><span class="pre">yaml</span></tt>, and <tt class="docutils literal"><span class="pre">pp</span></tt>.</p> +<p><strong>Show as raw JSON data</strong></p> +<p>To view node information in raw JSON, use the <tt class="docutils literal"><span class="pre">-l</span></tt> or <tt class="docutils literal"><span class="pre">--long</span></tt> option:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l -F json <node_name> +</pre></div> +</div> +<p>and/or:</p> +<div class="highlight-bash"><div class="highlight"><pre>knife node show -l --format<span class="o">=</span>json <node_name> +</pre></div> +</div> +</div> +</div> +</div> + + + </div> + </div> + </div> + <div class="clearer"></div> + </div> + <div class="related"> + <h3>Navigation</h3> + <ul> + <li><a href="http://docs.opscode.com/chef/knife.html" target="_products">Knife</a>•</li> + <li><a href="http://docs.opscode.com/chef/resources.html" target="_products">Resources</a>•</li> + <li><a href="http://docs.opscode.com/chef/dsl_recipe.html" target="_products">Recipe DSL</a>•</li> + <li><a href="http://docs.opscode.com/chef/lwrps_custom.html" target="_products">LWRPs</a>•</li> + <li><a href="http://docs.opscode.com/search.html">Search the Docs</a>•</li> + <li><a href="http://docs.opscode.com/">Home</a> »</li> + + </ul> + </div> + + + <div class="footer"> + Documentation for current man pages for Knife. + + Send feedback to <a href="mailto:docs@getchef.com">docs@getchef.com</a>. + This work is licensed under a Creative Commons Attribution 3.0 Unported License. + + </div> + +<!-- Start of Async Google Analytics Code --> +<script type="text/javascript"> +var _gaq = _gaq || []; +var pluginUrl = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.') + 'google-analytics.com/plugins/ga/inpage_linkid.js'; +_gaq.push(['_setAccount', 'UA-6369228-7']); +_gaq.push(['_setDomainName', '.opscode.com']); +_gaq.push(['_setAllowHash', false]); +_gaq.push(['_setAllowLinker', true]); +_gaq.push(['_addIgnoredRef','opscode.com']); +_gaq.push(['_trackPageview']); + +(function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; + ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(ga, s); })(); +</script> +<!-- End of Async Google Analytics Code --> + + + +<!-- Start of Contact Analytics Code --> +<script type="text/javascript"> +(function() { + var didInit = false; + function initMunchkin() { + if(didInit === false) { + didInit = true; + Munchkin.init('255-VFB-268'); + } + } + var s = document.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = document.location.protocol + '//munchkin.marketo.net/munchkin.js'; + s.onreadystatechange = function() { + if (this.readyState == 'complete' || this.readyState == 'loaded') { + initMunchkin(); + } + }; + s.onload = initMunchkin; + document.getElementsByTagName('head')[0].appendChild(s); +})(); +</script> +<!-- End of Contact Analytics Code --> + + + </body> +</html>
\ No newline at end of file |