Method: Beaker::DSL::Roles#agent_only

Defined in:
lib/beaker/dsl/roles.rb

#agent_only(host) ⇒ Boolean

Determine if this host is exclusively an agent (only has a single role ‘agent’)

Examples:

Basic usage

if agent_only(host)
  puts "this host is ONLY an agent!"
end

Parameters:

  • host (Host)

    Beaker host to check

Returns:

  • (Boolean)

    True if agent-only, false otherwise



118
119
120
# File 'lib/beaker/dsl/roles.rb', line 118

def agent_only(host)
    host['roles'].length == 1 && host['roles'].include?('agent')
end