Skip to content

Commit

Permalink
Feat: support retrieving secrets from Vault where the listener ssl ce…
Browse files Browse the repository at this point in the history
…rtificate is not a puppet cert

This duplicates the options on the client.post for get_auth_token()

Without it the puppet agent successfully retrieves a token but cannot connect to Vault to retrieve a secret.
  • Loading branch information
firstnevyn committed Aug 4, 2022
1 parent ea9bae4 commit 8c0fce7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/puppet/functions/vault_lookup/lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def auth_login_body(vault_cert_role)

def get_secret(client, uri, token, namespace)
headers = { 'X-Vault-Token' => token, 'X-Vault-Namespace' => namespace }.delete_if { |_key, value| value.nil? }
secret_response = client.get(uri, headers: headers)
secret_response = client.get(uri,
headers: headers,
options: { include_system_store: true })
unless secret_response.success?
message = "Received #{secret_response.code} response code from vault at #{uri} for secret lookup"
raise Puppet::Error, append_api_errors(message, secret_response)
Expand Down

0 comments on commit 8c0fce7

Please sign in to comment.