Skip to content

Commit

Permalink
implement api_addr parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak authored and jsok committed Jan 31, 2020
1 parent cb38a82 commit 411bfd6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'max_lease_ttl' => $::vault::max_lease_ttl,
'disable_mlock' => $::vault::disable_mlock,
'ui' => $::vault::enable_ui,
'api_addr' => $::vault::api_addr,
})

$config_hash = merge($_config_hash, $::vault::extra_config)
Expand Down
8 changes: 8 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
# because Vault can block a scheduler thread". Default: number of CPUs
# on the system, retrieved from the ``processorcount`` Fact.
#
# * `api_addr`
# Specifies the address (full URL) to advertise to other Vault servers in the
# cluster for client redirection. This value is also used for plugin backends.
# This can also be provided via the environment variable VAULT_API_ADDR. In
# general this should be set as a full URL that points to the value of the
# listener address
#
# * `version`
# The version of Vault to install
#
Expand Down Expand Up @@ -105,6 +112,7 @@
$os = $::vault::params::os,
$arch = $::vault::params::arch,
Optional[Boolean] $enable_ui = $::vault::params::enable_ui,
Optional[String] $api_addr = undef,
Hash $extra_config = {},
) inherits ::vault::params {

Expand Down
18 changes: 17 additions & 1 deletion spec/classes/vault_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
default_lease_ttl: exist,
max_lease_ttl: exist,
disable_mlock: exist,
ui: exist
ui: exist,
api_addr: exist
)
end
end
Expand All @@ -125,6 +126,21 @@
}
end

context 'when disable mlock' do
let(:params) do
{
api_addr: 'something'
}
end


it {
expect(param_value(catalogue, 'File', '/etc/vault/config.json', 'content')).to include_json(
api_addr: 'something'
)
}
end

context 'when installed from archive' do
let(:params) { { install_method: 'archive' } }

Expand Down

0 comments on commit 411bfd6

Please sign in to comment.