sf-hiera-aws 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/lib/hiera/backend/sf_hiera_aws_backend.rb +14 -0
- 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: 5158fadbf94eccfdfafaebf7b175d3c11f36a841
|
4
|
+
data.tar.gz: d69011bbc8cd91207d999bbcb1889b88171a29cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bca35ff02edb74348a7e3d5a85e3160f6841b553ae8a09fbf350b741344f052eb7f92c21621069bbf2e58f4d2d9b3d5365b75b99d2d925bc6fe8c47364bdf378
|
7
|
+
data.tar.gz: e6dd2449724903a05aa7b013868cd4237e02d6dc816ae126ce221a4a8d4af04a264f03fb6a2eaf24932685fa7c070a7c06574de1c873b6d100a37959294cba6a
|
data/LICENSE.txt
CHANGED
@@ -7,8 +7,22 @@ class Hiera
|
|
7
7
|
public
|
8
8
|
|
9
9
|
def initialize
|
10
|
+
|
10
11
|
require 'aws-sdk-resources'
|
12
|
+
require 'net/http'
|
13
|
+
require 'json'
|
14
|
+
|
15
|
+
begin
|
16
|
+
http = Net::HTTP.new('169.254.169.254', 80)
|
17
|
+
http.open_timeout = 1
|
18
|
+
http.read_timeout = 1
|
19
|
+
instance_identity = JSON.parse(http.request(Net::HTTP::Get.new("/latest/dynamic/instance-identity/document")).body)
|
20
|
+
Aws.config.update({ region: instance_identity['region'] })
|
21
|
+
rescue Exception
|
22
|
+
Hiera.warn('No link-local endpoint - can\'t calculate region')
|
23
|
+
end
|
11
24
|
Hiera.debug('Hiera AWS SDK backend started')
|
25
|
+
|
12
26
|
end
|
13
27
|
|
14
28
|
def lookup (key, scope, order_override, resolution_type)
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Topper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|