5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/puppet/functions/vault_lookup/lookup.rb', line 5
Puppet::Functions.create_function(:'vault_lookup::lookup', Puppet::Functions::InternalFunction) do
dispatch :lookup do
cache_param
param 'String', :path
optional_param 'String', :vault_addr
optional_param 'Optional[String]', :cert_path_segment
optional_param 'String', :cert_role
optional_param 'String', :namespace
optional_param 'String', :field
optional_param 'Enum["cert", "approle", "agent", "agent_sink"]', :auth_method
optional_param 'String', :role_id
optional_param 'String', :secret_id
optional_param 'Optional[String]', :approle_path_segment
optional_param 'String', :agent_sink_file
return_type 'Sensitive'
end
dispatch :lookup_opts_hash do
cache_param
param 'String[1]', :path
param 'Hash[String[1], Data]', :options
return_type 'Sensitive'
end
def lookup_opts_hash(cache, path, options = {})
PuppetX::VaultLookup::Lookup.lookup(cache: cache,
path: path,
vault_addr: options['vault_addr'],
cert_path_segment: options['cert_path_segment'],
cert_role: options['cert_role'],
namespace: options['namespace'],
field: options['field'],
auth_method: options['auth_method'],
role_id: options['role_id'],
secret_id: options['secret_id'],
approle_path_segment: options['approle_path_segment'],
agent_sink_file: options['agent_sink_file'])
end
def lookup(cache,
path,
vault_addr = nil,
cert_path_segment = nil,
cert_role = nil,
namespace = nil,
field = nil,
auth_method = nil,
role_id = nil,
secret_id = nil,
approle_path_segment = nil,
agent_sink_file = nil)
PuppetX::VaultLookup::Lookup.lookup(cache: cache,
path: path,
vault_addr: vault_addr,
cert_path_segment: cert_path_segment,
cert_role: cert_role,
namespace: namespace,
field: field,
auth_method: auth_method,
role_id: role_id,
secret_id: secret_id,
approle_path_segment: approle_path_segment,
agent_sink_file: agent_sink_file)
end
end
|