Method: Chef::Role.list

Defined in:
lib/chef/role.rb

.list(inflate = false) ⇒ Object

Get the list of all roles from the API.



192
193
194
195
196
197
198
199
200
201
202
# File 'lib/chef/role.rb', line 192

def self.list(inflate = false)
  if inflate
    response = {}
    Chef::Search::Query.new.search(:role) do |n|
      response[n.name] = n unless n.nil?
    end
    response
  else
    chef_server_rest.get("roles")
  end
end