Skip to content

Commit aac210a

Browse files
committedFeb 2, 2016
Fixed data_dir path for both config/service
@legal90 kindly pointed out that the default value for ['consul']['config']['data_dir'] & ['consul']['service']['data_dir'] was changed to append 'data' as the last folder. Consul actually creates this directory for you when you start the service. And if you didn't change both, it could cause the Consul agent to fail.
1 parent f55f08b commit aac210a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎attributes/default.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
default['consul']['config']['bag_item'] = 'consul'
1616

1717
default['consul']['config']['path'] = join_path config_prefix_path, 'consul.json'
18-
default['consul']['config']['data_dir'] = join_path data_prefix_path, 'data'
18+
default['consul']['config']['data_dir'] = data_prefix_path
1919
default['consul']['config']['ca_file'] = join_path config_prefix_path, 'ssl', 'CA', 'ca.crt'
2020
default['consul']['config']['cert_file'] = join_path config_prefix_path, 'ssl', 'certs', 'consul.crt'
2121
default['consul']['config']['key_file'] = join_path config_prefix_path, 'ssl', 'private', 'consul.key'

‎test/spec/libraries/consul_service_linux_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
recipe 'consul::default'
1010

1111
it { expect(chef_run).to create_directory('/etc/consul/conf.d') }
12-
it { is_expected.to create_directory('/var/lib/consul/data') }
12+
it { is_expected.to create_directory('/var/lib/consul') }
1313
end
1414
end

‎test/spec/libraries/consul_service_windows_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
recipe 'consul::default'
2222

2323
it { expect(chef_run).to create_directory('C:\Program Files\consul\conf.d') }
24-
it { is_expected.to create_directory('C:\Program Files\consul\data') }
24+
it { is_expected.to create_directory('C:\Program Files\consul') }
2525
it { expect(chef_run).to install_nssm('consul').with(
2626
program: 'C:\Program Files\consul\consul.exe',
2727
args: 'agent -config-file="""C:\Program Files\consul\consul.json""" -config-dir="""C:\Program Files\consul\conf.d"""'

0 commit comments

Comments
 (0)