Skip to end of metadata
Go to start of metadata


Overview

Knife 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, and delete roles on nodes.


Knife's role subcommand provides this capability.

For more information about Knife, refer to the Knife documentation, and Managing Nodes With Knife for detail on the use of Knife to manage Nodes.
See Roles for more information on roles.

       
Knife commands all have the same form

Adding a role to a node with Knife

Note that you need to put the role in quotes when using the knife node run_list add subcommand.

Through an EDITOR

1. set EDITOR environment variable, for example:

2. create a new role, for example:

3. enter the data of the role in JSON, for example:

4. Save it. If there isn't an existing role with the same name, you will see a warning message about that, which is normal. For example:

Editing a role with Knife

1. set EDITOR environment variable, for example:

2. edit a role, for example:

3. Update the JSON in the editor.
4. Save it.

Viewing a role with Knife

Listing roles with Knife

Deleting a role with Knife







Managing Nodes With Knife


Knife Plugins



Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.