1. knife-role(1)
  2. Chef Manual
  3. knife-role(1)

NAME

knife-role - Group common configuration settings

SYNOPSIS

knife role sub-command (options)

ROLE SUB-COMMANDS

The following role subcommands are available:

LIST

knife role list (options)

-w, --with-uri
Show corresponding URIs

List roles.

SHOW

knife role show ROLE (options)

-a, --attribute ATTR
Show only one attribute

Show a specific role.

CREATE

knife role create ROLE (options)

-d, --description
The role description

Create a new role.

EDIT

knife role edit ROLE (options)

Edit a role.

FROM FILE

knife role from file FILE (options)

Create or update a role from a role Ruby DSL (.rb) or JSON file.

DELETE

knife role delete ROLE (options)

Delete a role.

BULK DELETE

knife role bulk delete REGEX (options)

Delete roles on the Chef Server based on a regular expression. The regular expression (REGEX) should be in quotes, not in //'s.

DESCRIPTION

Roles provide a mechanism to group repeated configuration settings. Roles are data structures that contain default_attributes, and override_attributes, which are nested hashes of configuration settings, and a run_list, which is an ordered list of recipes and roles that should be applied to a host by chef-client.

default_attributes will be overridden if they conflict with a value on a node that includes the role. Conversely, override_attributes will override any values set on nodes that apply them.

When chef-client(8) configures a host, it will "expand" the run_list included in that host's node data. The expansion process will recursively replace any roles in the run_list with that role's run_list.

SEE ALSO

knife-node(1) knife-environment(1) http://wiki.opscode.com/display/chef/Roles http://wiki.opscode.com/display/chef/Attributes

AUTHOR

Chef was written by Adam Jacob adam@opscode.com with many contributions from the community.

DOCUMENTATION

This manual page was written by Joshua Timberman joshua@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

  1. Chef 11.0.0.rc.0
  2. February 2013
  3. knife-role(1)