File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,14 @@ def action_enable
8484 not_if { new_resource . disable_mlock }
8585 not_if "getcap #{ new_resource . program } |grep cap_ipc_lock+ep"
8686 end
87+
88+ # if /data directory mounted then we need to symlink /var/log/vault to /data/var/log/vault
89+ if ::File . directory? ( '/data' )
90+ link '/var/log/vault' do
91+ to ::File . join ( '/data' , '/var/log/vault' )
92+ action :create
93+ end
94+ end
8795 end
8896 super
8997 end
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.8 '
9+ version '1002.7.9 '
1010
1111supports 'ubuntu' , '>= 12.04'
1212supports 'redhat' , '>= 6.4'
Original file line number Diff line number Diff line change 1212
1313 before do
1414 stub_command ( 'getcap /opt/vault/0.9.1/vault|grep cap_ipc_lock+ep' ) . and_return ( false )
15+
16+ # Create the /data directory to simulate the mount
17+ allow ( File ) . to receive ( :directory? ) . with ( '/data' ) . and_return ( true )
1518 end
1619
1720 context 'with default properties' do
1821 it { is_expected . to run_execute 'setcap cap_ipc_lock=+ep /opt/vault/0.9.1/vault' }
22+
23+ #Test for symlink creation
24+ it 'creates a symlink for /var/log/vault to /data/var/log/vault' do
25+ expect ( chef_run ) . to create_link ( '/var/log/vault' ) . with ( to : '/data/var/log/vault' )
1926 end
2027end
You can’t perform that action at this time.
0 commit comments