|
OverviewKnife is a command-line tool that comes with Chef.It is used by administrators to interact with the Chef Server API, the local Chef repository and can be used to create, edit, view, list, tag and delete nodes.
|
|
Creating a node with KnifeCreate a new node. Note: A node is created the first time you run chef-client, or when you use Knife Bootstrap commands. Unless the --no-editor option is given, an empty node object will be created and displayed in your text editor. If the editor exits with a successful exit status, the node data will be posted to the Chef Server to create the node. Through an EDITOR
Create a node from a JSON fileEditing a node with KnifeEdit an existing node. The JSON description of the node will be opened with EDITOR and saved back to the Chef Server once editing is complete. See Nodes for more information on the node description. Through an EDITOR
Add to a node's run list.This will add RUNLIST_ITEM to the run list of NODE. Additional Options:
Details: Recipe additionWhen adding a recipe to a run list, there are several valid formats:
Roles additionRoles can be added to a run list using the following format: Note that you need to put the role in quotes when using the knife node run_list add subcommand. Example: Remove an item from a node's run list.Viewing or Showing a node with KnifeDisplays information about a node. Knife 0.10+ and above do not display all node attributes by default. The full list of attributes is very large and are thus suppressed from the default output. You can see all of the node data by choosing JSON formatted output via the -Fj option. Additional Options:
Examples Note that when displaying a single attribute, the value shown is determined via attribute precedence. (See Attributes for more information.) Examples: Viewing the run list of a node Listing the nodesList all nodes. Additional Options:
Examples: Deleting a node with KnifeRemoving a node from being managed via the Chef Server. bulk deleteDeletes nodes for which the name matches the regular expression on the Chef Server. The regular expression should be given in quotes, and should not be surrounded with forward slashes. delete an individual nodeDeletes a node from the Chef Server. Additional Options:
Note: Deleting the node does not delete any corresponding API client for the node. Using TAGSYou can also "tag" nodes and then manage them with knife through those tags. Creating a new node with a TAGList a node's TAGsDeleting Node based on TAGs
|
|
|


