Method: Beaker::DSL::Roles#not_controller

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

#not_controller(host) ⇒ Boolean

Determine if host is not a controller, does not have roles ‘master’, ‘dashboard’ or ‘database’.

Examples:

Basic usage

if not_controller(host)
  puts "this host isn't in charge!"
end

Returns:

  • (Boolean)

    True if agent-only, false otherwise



102
103
104
105
106
# File 'lib/beaker/dsl/roles.rb', line 102

def not_controller(host)
  controllers = ['dashboard', 'database', 'master', 'console']
  matched_roles = host['roles'].select { |v| controllers.include?(v) }
  matched_roles.length == 0
end