Class: Kondate::HostPlugin::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/kondate/host_plugin/base.rb

Direct Known Subclasses

File

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.

Parameters:

  • config (HashWithIndifferentAccess)


7
8
9
# File 'lib/kondate/host_plugin/base.rb', line 7

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/kondate/host_plugin/base.rb', line 4

def config
  @config
end

Instance Method Details

#get_environment(host) ⇒ String

Returns environment name.

Parameters:

  • host (String)

    hostname

Returns:

  • (String)

    environment name



13
14
15
# File 'lib/kondate/host_plugin/base.rb', line 13

def get_environment(host)
  ENV['ENVIRONMENT'] || 'development'
end

#get_hosts(role) ⇒ Array

Available from kondate >= 0.3.0

Parameters:

  • role (String)

    role

Returns:

  • (Array)

    array of hosts

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/kondate/host_plugin/base.rb', line 27

def get_hosts(role)
  raise NotImplementedError
end

#get_roles(host) ⇒ Array

Returns array of roles.

Parameters:

  • host (String)

    hostname

Returns:

  • (Array)

    array of roles

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/kondate/host_plugin/base.rb', line 19

def get_roles(host)
  raise NotImplementedError
end