hubcap 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/hubcap/group.rb +18 -0
- data/lib/hubcap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6c7801199d9b0a21c799941f3ef21c7734562bd
|
|
4
|
+
data.tar.gz: 30d80572504bef6604ec5732794fe03e07b5af08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b4e62ef8235240a68b5f9dc9920069cda86c099edbc2fa1e4d8d8628e78ac573a21190561ae78888f61ad9396b3c48ea38caa0254d7e4d80637e72334c7124a
|
|
7
|
+
data.tar.gz: 501d4a8444084f68b789cfb5743fabf86b1dfe0d42c9cb4e9c106f40994c8da973181528f95b51fd18d1d112dc5faea6db00a9ed5b7ff70ba6dec87d81cb7211
|
data/Gemfile.lock
CHANGED
data/lib/hubcap/group.rb
CHANGED
|
@@ -20,6 +20,7 @@ class Hubcap::Group
|
|
|
20
20
|
@cap_roles = []
|
|
21
21
|
@puppet_roles = {}
|
|
22
22
|
@params = {}
|
|
23
|
+
@extra_attributes = {}
|
|
23
24
|
@hosts = {}
|
|
24
25
|
@children = []
|
|
25
26
|
instance_eval(&blk) if blk && processable?
|
|
@@ -203,6 +204,20 @@ class Hubcap::Group
|
|
|
203
204
|
update_with_stringified_keys(@params, hash)
|
|
204
205
|
end
|
|
205
206
|
|
|
207
|
+
# Adds extra (inheritable) attributes to the referencing scope
|
|
208
|
+
# These attributes are not used by hubcap or puppet, but can be used by
|
|
209
|
+
# by other tools using hubcap to parse the configuration tree.
|
|
210
|
+
#
|
|
211
|
+
# extra({'some_key' => 'some_value'})
|
|
212
|
+
#
|
|
213
|
+
def extra(hash)
|
|
214
|
+
hash.each_key { |k|
|
|
215
|
+
unless k.kind_of?(String) || k.kind_of?(Symbol)
|
|
216
|
+
raise(Hubcap::InvalidParamKeyType, k.inspect)
|
|
217
|
+
end
|
|
218
|
+
}
|
|
219
|
+
update_with_stringified_keys(@extra_attributes, hash)
|
|
220
|
+
end
|
|
206
221
|
|
|
207
222
|
# Defines hostnames that point to IP addresses. Eg,
|
|
208
223
|
#
|
|
@@ -249,6 +264,9 @@ class Hubcap::Group
|
|
|
249
264
|
@parent ? @parent.hosts.merge(@hosts) : @hosts
|
|
250
265
|
end
|
|
251
266
|
|
|
267
|
+
def extras
|
|
268
|
+
@parent ? @parent.extras.merge(@extra_attributes) : @extra_attributes
|
|
269
|
+
end
|
|
252
270
|
|
|
253
271
|
# Takes a name and returns an IP address. It looks at the @hosts table first,
|
|
254
272
|
# then falls back to a normal DNS look-up.
|
data/lib/hubcap/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hubcap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joseph Pearson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capistrano
|