Get role data

The Get Role Data activity retrieves additional information about a given Chef role.

The activity stores retrieved role data in the roleData sensor script variable as a JavaScript object. The object contains the following fields, as well as all fields returned by the Chef Request activity:

Table 1. Object fields
Object Description
role_name The name of the role, passed in the Role data activity input variable
description A description of the role, if available
run_list The list of recipes and other roles that the role contains
default_attributes Attributes that apply to nodes with this role
override_attributes Attributes that apply to nodes with this role. These attributes can override a default attribute inherited from a parent role
Table 2. Results table
Result Description
Success The Chef server returned a response. The activity returns a successful result even if one or more Chef requests failed. To determine the success of a specific request, use the success value from an object stored in the roleData variable
Failure The Chef server was not available or rejected the supplied credentials
Table 3. Input variables table
Field Description
Role data An array of JavaScript objects that defines which roles to get more information about. Each object contains the following field:
  • role_name: the name of the role to get more information about.