jerakia 0.1.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/jerakia +1 -1
- data/lib/hiera/backend/jerakia_backend.rb +1 -1
- data/lib/jerakia/cache.rb +2 -1
- data/lib/jerakia/config.rb +1 -1
- data/lib/jerakia/datasource/http.rb +68 -0
- data/lib/jerakia/lookup/plugin/hiera.rb +2 -2
- data/lib/jerakia.rb +1 -1
- metadata +18 -4
- data/lib/jerakia/foobar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfa6b5b4e283d6a8eac75289da4e456cdf7b4365
|
4
|
+
data.tar.gz: fd106c3ac2c92d1e18ff1a598b12ccde5a67bc40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7083168d80c4d3d9927eaee085b43199847321911dd63fb1866c5e18ba88aaacce65eb947fe9264c29feb35769152afd3bc8a68bbf60a9450e277c0e5b214610
|
7
|
+
data.tar.gz: 51a5f837b4b4b948e5f70f43116be92dfca2fd016104275d2c7901cb1d71f78e3a6f49d19a94adb29ef315e022f6f707c7192894b9ddecd05bbf141505d8868f
|
data/bin/jerakia
CHANGED
data/lib/jerakia/cache.rb
CHANGED
data/lib/jerakia/config.rb
CHANGED
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'lookup_http'
|
2
|
+
|
3
|
+
|
4
|
+
class Jerakia::Datasource
|
5
|
+
module Http
|
6
|
+
|
7
|
+
def run
|
8
|
+
#
|
9
|
+
# Do the lookup
|
10
|
+
|
11
|
+
Jerakia.log.debug("Searching key #{lookup.request.key} using the http datasource (#{whoami})")
|
12
|
+
|
13
|
+
|
14
|
+
option :host, { :type => String, :mandatory => true }
|
15
|
+
option :port, { :type => Integer, :default => 80 }
|
16
|
+
option :output, { :type => String, :default => 'json' }
|
17
|
+
option :failure, { :type => String, :default => 'graceful' }
|
18
|
+
option :ignore_404, { :default => true }
|
19
|
+
option :headers, { :type => Hash }
|
20
|
+
option :http_read_timeout, { :type => Integer }
|
21
|
+
option :use_ssl
|
22
|
+
option :ssl_ca_cert, { :type => String }
|
23
|
+
option :ssl_cert, { :type => String }
|
24
|
+
option :ssl_key, { :type => String }
|
25
|
+
option :ssl_verify
|
26
|
+
option :use_auth
|
27
|
+
option :auth_user, { :type => String }
|
28
|
+
option :auth_pass, { :type => String }
|
29
|
+
option :http_connect_timeout,{ :type => Integer }
|
30
|
+
option :paths, { :type => Array, :mandatory => true }
|
31
|
+
|
32
|
+
|
33
|
+
lookup_supported_params = [
|
34
|
+
:host,
|
35
|
+
:port,
|
36
|
+
:output,
|
37
|
+
:failure,
|
38
|
+
:ignore_404,
|
39
|
+
:headers,
|
40
|
+
:http_connect_timeout,
|
41
|
+
:http_read_timeout,
|
42
|
+
:use_ssl,
|
43
|
+
:ssl_ca_cert,
|
44
|
+
:ssl_cert,
|
45
|
+
:ssl_key,
|
46
|
+
:ssl_verify,
|
47
|
+
:use_auth,
|
48
|
+
:auth_user,
|
49
|
+
:auth_pass,
|
50
|
+
]
|
51
|
+
lookup_params = options.select { |p| lookup_supported_params.include?(p) }
|
52
|
+
http_lookup = LookupHttp.new(lookup_params)
|
53
|
+
|
54
|
+
options[:paths].flatten.each do |path|
|
55
|
+
Jerakia.log.debug("Attempting to load data from #{path}")
|
56
|
+
return unless response.want?
|
57
|
+
data=http_lookup.get_parsed(path)
|
58
|
+
Jerakia.log.debug("Datasource provided #{data} looking for key #{lookup.request.key}")
|
59
|
+
if data[lookup.request.key]
|
60
|
+
Jerakia.log.debug("Found data #{data[lookup.request.key]}")
|
61
|
+
response.submit data[lookup.request.key]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# This plugin reformats the lookup key according to a puppet's
|
2
|
-
# Hiera system, so instead of looking up <key> in <path>/<namespace>.
|
3
|
-
# we lookup <namespace>::<key> in <path>.
|
2
|
+
# Hiera system, so instead of looking up <key> in <path>/<namespace>.yaml
|
3
|
+
# we lookup <namespace>::<key> in <path>.yaml
|
4
4
|
#
|
5
5
|
# This is a useful plugin for people wanting to test drive Jerakia
|
6
6
|
# but maintain an existing hiera filesystem layout and naming convention
|
data/lib/jerakia.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jerakia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
12
|
-
dependencies:
|
11
|
+
date: 2015-10-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: lookup_http
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0
|
13
27
|
description: Extendable and flexible data lookup system
|
14
28
|
email:
|
15
29
|
executables:
|
@@ -30,7 +44,7 @@ files:
|
|
30
44
|
- lib/jerakia/datasource/dummy.rb
|
31
45
|
- lib/jerakia/datasource/file.rb
|
32
46
|
- lib/jerakia/datasource/file/yaml.rb
|
33
|
-
- lib/jerakia/
|
47
|
+
- lib/jerakia/datasource/http.rb
|
34
48
|
- lib/jerakia/launcher.rb
|
35
49
|
- lib/jerakia/log.rb
|
36
50
|
- lib/jerakia/lookup.rb
|
data/lib/jerakia/foobar
DELETED
File without changes
|