Class: Mrsk::Configuration::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/mrsk/configuration/role.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, config:) ⇒ Role

Returns a new instance of Role.



6
7
8
# File 'lib/mrsk/configuration/role.rb', line 6

def initialize(name, config:)
 @name, @config = name.inquiry, config
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/mrsk/configuration/role.rb', line 4

def name
  @name
end

Instance Method Details

#cmdObject



26
27
28
# File 'lib/mrsk/configuration/role.rb', line 26

def cmd
  specializations["cmd"]
end

#hostsObject



10
11
12
# File 'lib/mrsk/configuration/role.rb', line 10

def hosts
  @hosts ||= extract_hosts_from_config
end

#label_argsObject



22
23
24
# File 'lib/mrsk/configuration/role.rb', line 22

def label_args
  argumentize "--label", labels
end

#labelsObject



14
15
16
17
18
19
20
# File 'lib/mrsk/configuration/role.rb', line 14

def labels
  if name.web?
    default_labels.merge(traefik_labels).merge(custom_labels)
  else
    default_labels.merge(custom_labels)
  end
end