Class | Chef::Role
In: | lib/chef/role.rb
Parent: | Object

### Methods

active_run_list_for cdb_destroy cdb_list cdb_load cdb_save chef_server_rest chef_server_rest couchdb_id= create create_design_document default_attributes description destroy env_run_list env_run_lists environment environments exists? from_disk json_create list load name new override_attributes recipes run_list run_list_for save sync_from_disk_to_couchdb to_hash to_json to_s update_from!

### Included Modules

Chef::Mixin::FromFile Chef::Mixin::ParamsValidate Chef::IndexQueue::Indexable

### Constants

DESIGN_DOCUMENT | = | { "version" => 6, "language" => "javascript", "views" => { "all" => { "map" => <<-EOJS function(doc) { if (doc.chef_type == "role") { emit(doc.name, doc); } } EOJS

### Attributes

couchdb | [RW] |
couchdb_id | [R] |
couchdb_rev | [RW] |

### Public Class methods

cdb_list(inflate=false, couchdb=nil)

List all the Chef::Role objects in the CouchDB. If inflate is set to true, you will get the full list of all Roles, fully inflated.

cdb_load(name, couchdb=nil)

Load a role by name from CouchDB

chef_server_rest()
create_design_document(couchdb=nil)

Set up our CouchDB design document

exists?(rolename, couchdb)
from_disk(name, force=nil)

Load a role from disk - prefers to load the JSON, but will happily load the raw rb files as well.

json_create(o)

Create a Chef::Role from JSON

list(inflate=false)

Get the list of all roles from the API.

load(name)

Load a role by name from the API

new(couchdb=nil)

Create a new Chef::Role object.

sync_from_disk_to_couchdb()

Sync all the json roles with couchdb from disk

### Public Instance methods

active_run_list_for(environment)
cdb_destroy()

Remove this role from the CouchDB

cdb_save()

Save this role to the CouchDB

chef_server_rest()
couchdb_id=(value)
create()

Create the role via the REST API

default_attributes(arg=nil)
description(arg=nil)
destroy()

Remove this role via the REST API

env_run_list(env_run_lists=nil)

Alias for env_run_lists

env_run_lists(env_run_lists=nil)

Per environment run lists

environment(env_name)
environments()
name(arg=nil)
override_attributes(arg=nil)
recipes(*args)

Alias for run_list

run_list(*args)
run_list_for(environment)

For run_list expansion

save()

Save this role via the REST API

to_hash()
to_json(*a)

Serialize this object as a hash

to_s()

As a string

update_from!(o)

[Validate]