Skip to content

Commit f4b79c1

Browse files
committed
Explicitly specify log directory root
1 parent f47d116 commit f4b79c1

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

libraries/vault_service.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,17 @@ def action_enable
8686
end
8787

8888
# if /data directory mounted then we need to symlink /var/log/vault to /data/var/log/vault
89-
log_path = ::File.join('var', 'log', 'vault')
90-
if ::File.directory?('/data')
89+
log_path = ::File.join('/', 'var', 'log', 'vault')
90+
data_root_path = ::File.join('/', 'data')
91+
if ::File.directory?(data_root_path)
9192
# if /var/log/vault exists and is not a link, move to /var/log/vault.[created_at timestamp]
92-
data_path = ::File.join('data', log_path)
93+
data_log_path = ::File.join(data_root_path, log_path)
9394
if ::File.directory?(log_path) && !::File.symlink?(log_path)
9495
created_at = ::File.ctime(log_path).strftime('%Y%m%d%H%M%S')
9596
new_path = ::File.join(log_path, created_at)
9697
::FileUtils.mv(log_path, new_path)
9798
end
98-
directory data_path do
99+
directory data_log_path do
99100
owner new_resource.user
100101
group new_resource.group
101102
mode '0750'

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
long_description 'Application cookbook for installing and configuring Vault.'
77
issues_url 'https://github.com/johnbellone/vault-cookbook/issues'
88
source_url 'https://github.com/johnbellone/vault-cookbook/'
9-
version '1002.8.2'
9+
version '1002.8.3'
1010

1111
supports 'ubuntu', '>= 12.04'
1212
supports 'redhat', '>= 6.4'

test/fixtures/policies/default.lock.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"revision_id": "cf88d87c2e217b43768c138a26d14d6f6aa42c90d5f9ef327d76b2da484ab99e",
2+
"revision_id": "7f234aeea4304db41b948750f48a92a123f09633aa4819b3ac97662c9d0132d0",
33
"name": "default",
44
"run_list": [
55
"recipe[hashicorp-vault::default]"
@@ -42,19 +42,20 @@
4242
}
4343
},
4444
"hashicorp-vault": {
45-
"version": "1002.7.14",
46-
"identifier": "43b55d582607b499299d4ab83675d312ac31bea1",
47-
"dotted_decimal_identifier": "19058235955087284.43111426976921205.232077151813281",
45+
"version": "1002.8.2",
46+
"identifier": "17e8b4f68f71d07a0f1f06c70f678074ce2f3685",
47+
"dotted_decimal_identifier": "6729788392698320.34356573090811751.141239163762309",
4848
"source": "../../..",
4949
"cache_key": null,
5050
"scm_info": {
5151
"scm": "git",
5252
"remote": null,
53-
"revision": "8ad3efdd3d6ac6282438455d6d962763419f0368",
53+
"revision": "f47d116493f819158c43f09d9ba0eaf74e4b78b4",
5454
"working_tree_clean": false,
5555
"published": true,
5656
"synchronized_remote_branches": [
57-
"origin/create_var_log_vault_directory_in_cookbook"
57+
"origin/HEAD -> origin/master",
58+
"origin/master"
5859
]
5960
},
6061
"source_options": {
@@ -200,7 +201,7 @@
200201
"~> 5.0"
201202
]
202203
],
203-
"hashicorp-vault (1002.7.14)": [
204+
"hashicorp-vault (1002.8.2)": [
204205
[
205206
"build-essential",
206207
">= 0.0.0"

0 commit comments

Comments
 (0)