Use vault_api_addr to set VAULT_ADDR in .bashrc #263
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this PR,
vault_api_addr
andvault_cluster_addr
were defined using the IPv4 address of the default interface of the host. Moreover, a variable namedvault_hostname
was used to run the reachability check but was undocumented.This change documents
vault_hostname
and leverages it to set the value ofvault_api_addr
andvault_cluster_addr
when it's available. Otherwise, these vars are defined as before.Moreover,
vault_api_addr
is now used to set the URL used by the reachability check and to set the value ofVAULT_ADDR
in .bashrc. Before that change, these URLs were define by concatenating the value ofvault_addr
andvault_port
together.vault_addr
was defined as being either127.0.0.1
(whenvault_address
was0.0.0.0
) or the value ofvault_address
. However,vault_address
is used to define the IP address Vault should bind to. Although, by default, they were defined to be exactly the same asvault_api_addr
default value, when overriding that param (for instance to put an hostname instead of the IP address), the value ofVAULT_ADDR
(and the URL used by the reachability check) could be wrong in some cases (eg. when using TLS certs with noIP: 127.0.0.1
SAN). Instead of adding a new var to override the value ofVAULT_ADDR
, this change reuses the value ofvault_api_addr
, which is now defined throughvault_hostname
param (when provided).