Class: Hubcap::Server
Constant Summary
Constants inherited
from Group
Group::IP_PATTERN
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_role, #cap_roles, #cap_set, #collectable?, #extra, #extras, #history, #host, #hosts, #hub, #lookup, #param, #params, #processable?, #puppet_role, #puppet_roles, #resolv, #role
Constructor Details
#initialize(parent, name, options = {}, &blk) ⇒ Server
Returns a new instance of Server.
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/hubcap/server.rb', line 6
def initialize(parent, name, options = {}, &blk)
super(parent, name, &blk)
hist = history.join('.')
param('server_name' => hist) if params['server_name'].nil?
unless @address = options[:address]
@address = lookup(hist)
@address = lookup(name) if @address == hist
end
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
37
38
39
40
41
42
43
44
|
# File 'lib/hubcap/server.rb', line 37
def application_parent
p = self
while p && p != hub
return p if p.kind_of?(Hubcap::Application)
p = p.instance_variable_get(:@parent)
end
nil
end
|
#yaml ⇒ Object
47
48
49
|
# File 'lib/hubcap/server.rb', line 47
def yaml
{ 'classes' => puppet_roles, 'parameters' => params }.to_yaml
end
|