Class: Hubcap::Server
Instance Attribute Summary collapse
Attributes inherited from Group
#children, #name, #parent
Instance Method Summary
collapse
Methods inherited from Group
#absorb, #cap_attribute, #cap_attributes, #cap_roles, #cap_set, #collectable?, #history, #hub, #param, #params, #processable?, #puppet_roles, #role, #tree
Constructor Details
#initialize(parent, name, options = {}, &blk) ⇒ Server
Returns a new instance of Server.
6
7
8
9
|
# File 'lib/hubcap/server.rb', line 6
def initialize(parent, name, options = {}, &blk)
@address = options[:address] || name
super(parent, name, &blk)
end
|
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3
4
5
|
# File 'lib/hubcap/server.rb', line 3
def address
@address
end
|
Instance Method Details
#application(*args) ⇒ Object
#application_parent ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/hubcap/server.rb', line 27
def application_parent
p = self
while p && p != hub
return p if p.kind_of?(Hubcap::Application)
p = p.instance_variable_get(:@parent)
end
end
|
#yaml ⇒ Object
36
37
38
39
40
41
|
# File 'lib/hubcap/server.rb', line 36
def yaml
{
'classes' => puppet_roles.collect(&:to_s),
'parameters' => params
}.to_yaml
end
|