Skip to content

Commit

Permalink
Merge pull request #11 from Roblox/PO-777_optional_service_registration
Browse files Browse the repository at this point in the history
Update test Vault version to 1.6.1 and make service_registration opti…
  • Loading branch information
roberteckert authored Mar 16, 2021
2 parents 85f886a + 01e27fe commit eaf7b5c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ verifier:
name: inspec

platforms:
- name: ubuntu-18.04
- name: ubuntu-16.04
- name: centos-7.2

Expand Down
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
default['hashicorp-vault']['service_user'] = 'vault'
default['hashicorp-vault']['service_group'] = 'vault'

default['hashicorp-vault']['version'] = '1.3.4'
default['hashicorp-vault']['version'] = '1.6.1'

default['hashicorp-vault']['archive_url_root'] = 'releases.hashicorp.com'

Expand Down
4 changes: 2 additions & 2 deletions libraries/vault_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class VaultConfig < Chef::Resource
attribute(:default_lease_ttl, kind_of: String)
attribute(:max_lease_ttl, kind_of: String)
# Service Registration options
attribute(:service_registration_type, default: 'consul', equal_to: %w(consul kubernetes))
attribute(:service_registration_type, equal_to: %w(consul kubernetes))
attribute(:service_registration_options, option_collector: true)
# Storage options
attribute(:storage_type, default: 'inmem', equal_to: %w(consul etcd zookeeper dynamodb s3 mysql postgresql inmem file raft))
Expand Down Expand Up @@ -95,7 +95,7 @@ def to_json
end.merge(tls_disable: tls_disable.to_s)
config['listener'] = { 'tcp' => listener_options }
# service registration
config['service_registration'] = { service_registration_type => (service_registration_options || {}) }
config['service_registration'] = { service_registration_type => (service_registration_options || {}) } if service_registration_type
# storage
config['storage'] = { storage_type => (storage_options || {}) }
# ha_storage, only some storages support HA
Expand Down
2 changes: 1 addition & 1 deletion test/integration/default/inspec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe file('/opt/vault/1.3.4/vault') do
describe file('/opt/vault/1.6.1/vault') do
it { should be_file }
it { should be_executable }
end
Expand Down
2 changes: 1 addition & 1 deletion test/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

it { expect(chef_run).to create_poise_service_user('vault').with(group: 'vault') }
it { expect(chef_run).to create_vault_config('/etc/vault/vault.json') }
it { expect(chef_run).to create_vault_installation('0.9.1') }
it { expect(chef_run).to create_vault_installation('1.6.1') }
it { expect(chef_run).to enable_vault_service('vault').with(config_path: '/etc/vault/vault.json') }
it { expect(chef_run).to start_vault_service('vault') }
end
Expand Down

0 comments on commit eaf7b5c

Please sign in to comment.