sf-hiera-aws 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +15 -1
- data/lib/hiera/backend/sf_hiera_aws_backend.rb +19 -3
- data/sf-hiera-aws.gemspec +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: b73f19d1e2fa60079f083fc811a93d31e1809e05
|
4
|
+
data.tar.gz: 973b153e2fd3e28aa3428ae1851ceeed1c122be1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de055c8caff12473c42334a667ee1fd8a1dcb279dc3feb6290bceede10a41ad45332975d99f4a1b54008e5ea3e6d530eb477d6398b326304a629f1970ab21f2
|
7
|
+
data.tar.gz: 0a4d000856825e1acf1fe686cf185a3734d0f9358f7f2e9ec03eb03ab8adc044b7e84ee5b6a485f641ff16286590b36480e08b1c6b86a3738bba04014590884b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -58,7 +58,21 @@ aws_am_search_nodes:
|
|
58
58
|
- :private_dns_name
|
59
59
|
```
|
60
60
|
|
61
|
-
The value of `return` here is also the default, and so can be omitted. You can use any of the methods listed at http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html to obtain other details from the Instance object.
|
61
|
+
The value of `return` here is also the default, and so can be omitted. You can use any of the methods listed at http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Instance.html to obtain other details from the Instance object. Calls to this key will return a list of hashes, each containing `instace_id`, `private_ip_address` and `private_dns_name` keys.
|
62
|
+
|
63
|
+
### Example - EC2 nodes by tag, single item list
|
64
|
+
|
65
|
+
```
|
66
|
+
aws_am_search_nodes:
|
67
|
+
type: :ec2_instance
|
68
|
+
filters:
|
69
|
+
- name: tag:aws:autoscaling:groupName
|
70
|
+
values: [ "%{::sf_location}-%{::sf_environment}-search" ]
|
71
|
+
return: :private_ip_address
|
72
|
+
```
|
73
|
+
|
74
|
+
Here, we pass a single symbol to the `return` argument. In this case, we'll get back a list of strings containing private ip addresses (rather than a list of hashes).
|
75
|
+
|
62
76
|
|
63
77
|
|
64
78
|
### Example - RDS instance by name
|
@@ -164,9 +164,25 @@ class Hiera
|
|
164
164
|
end
|
165
165
|
|
166
166
|
instances.collect do |i|
|
167
|
-
|
168
|
-
|
169
|
-
|
167
|
+
if options['return'].is_a?(Array)
|
168
|
+
|
169
|
+
# If the 'return' option is a list, we treat these
|
170
|
+
# as a list of desired hash keys, and return a hash
|
171
|
+
# containing only those keys from the API call
|
172
|
+
|
173
|
+
Hash[options['return'].map do |f|
|
174
|
+
[f.to_s, i.key?(f) ? i[f] : nil]
|
175
|
+
end]
|
176
|
+
|
177
|
+
elsif options['return'].is_a?(Symbol)
|
178
|
+
|
179
|
+
# If the 'return' option is a symbol, we treat that
|
180
|
+
# as the one hash key we care about, and return a list
|
181
|
+
# of that.
|
182
|
+
|
183
|
+
i.key?(options['return']) ? i[options['return']] : nil
|
184
|
+
|
185
|
+
end
|
170
186
|
end
|
171
187
|
end
|
172
188
|
|
data/sf-hiera-aws.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sf-hiera-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Topper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|