File tree Expand file tree Collapse file tree 4 files changed +46
-1
lines changed
test/integration/test_data_dir/inspec Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ suites:
2727 - name : default
2828 provisioner : &default-provisioner
2929 policyfile : test/fixtures/policies/default.rb
30+ - name : test_data_dir
31+ provisioner :
32+ << : *default-provisioner
33+ policyfile : test/fixtures/policies/default.rb
34+ lifecycle :
35+ post_create :
36+ - remote : sudo mkdir -p /data
3037 - name : test_unauthenticated_metrics
3138 provisioner :
3239 << : *default-provisioner
Original file line number Diff line number Diff line change @@ -87,6 +87,13 @@ def action_enable
8787
8888 # if /data directory mounted then we need to symlink /var/log/vault to /data/var/log/vault
8989 if ::File . directory? ( '/data' )
90+ # if /var/log/vault exists and is not a link, move to /var/log/vault.[created_at timestamp]
91+ path = '/var/log/vault'
92+ if ::File . directory? ( path ) && !::File . symlink? ( path )
93+ created_at = ::File . birthtime ( path ) . strftime ( '%Y%m%d%H%M%S' )
94+ new_path = "#{ path } .#{ created_at } "
95+ ::FileUtils . mv ( path , new_path )
96+ end
9097 link '/var/log/vault' do
9198 to ::File . join ( '/data' , '/var/log/vault' )
9299 action :create
Original file line number Diff line number Diff line change 66long_description 'Application cookbook for installing and configuring Vault.'
77issues_url 'https://github.com/johnbellone/vault-cookbook/issues'
88source_url 'https://github.com/johnbellone/vault-cookbook/'
9- version '1002.7.9 '
9+ version '1002.7.10 '
1010
1111supports 'ubuntu' , '>= 12.04'
1212supports 'redhat' , '>= 6.4'
Original file line number Diff line number Diff line change 1+ describe file ( '/opt/vault/1.8.5/vault' ) do
2+ it { should be_file }
3+ it { should be_executable }
4+ end
5+
6+ describe group ( 'vault' ) do
7+ it { should exist }
8+ end
9+
10+ describe user ( 'vault' ) do
11+ it { should exist }
12+ end
13+
14+ describe file ( '/etc/vault/vault.json' ) do
15+ its ( 'mode' ) { should eq 0640 }
16+ it { should be_file }
17+ it { should be_owned_by 'vault' }
18+ it { should be_grouped_into 'vault' }
19+ its ( 'content' ) { should match /.*log_level.*/ }
20+ its ( 'content' ) { should match /.*reporting.*/ }
21+ end
22+
23+ describe file ( '/var/log/vault' ) do
24+ it { should be_symlink }
25+ end
26+
27+ describe service ( 'vault' ) do
28+ it { should be_installed }
29+ it { should be_enabled }
30+ it { should be_running }
31+ end
You can’t perform that action at this time.
0 commit comments