Skip to content

Commit

Permalink
set appropriate value for log_dir (deric#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Oct 17, 2017
1 parent 5a1ac7b commit d888a48
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
let(:cfg_dir) { '/etc/zookeeper/conf' }
let(:log_dir) { '/var/lib/zookeeper' }
let(:id_file) { '/etc/zookeeper/conf/myid' }
let(:myid) { /1/ }
let(:myid) { /^1/ }

precond = 'class {"zookeeper": }'

Expand All @@ -226,7 +226,7 @@
let(:cfg_dir) { '/var/lib/zookeeper/conf' }
let(:log_dir) { '/var/lib/zookeeper/log' }
let(:id_file) { '/var/lib/zookeeper/conf/myid' }
let(:myid) { /2/ }
let(:myid) { /^2/ }

it_behaves_like 'common', 'Debian', 'wheezy', '7', precond
end
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@
}
end

it do
is_expected.to contain_file(
'/etc/zookeeper/conf/log4j.properties'
).with_content(/zookeeper.log.dir=\/var\/log\/zookeeper/)
end

context 'set service provider' do
it { is_expected.to contain_package('zookeeper').with({:ensure => 'present'}) }
it do
Expand Down
2 changes: 1 addition & 1 deletion templates/conf/log4j.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ zookeeper.root.logger=<%= scope.lookupvar("zookeeper::log4j_prop") %>

zookeeper.console.threshold=<%= scope.lookupvar("zookeeper::console_threshold") %>

zookeeper.log.dir=.
zookeeper.log.dir=<%= scope.lookupvar("zookeeper::log_dir") %>
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=<%= scope.lookupvar("zookeeper::rollingfile_threshold") %>
zookeeper.log.maxfilesize=<%= scope.lookupvar("zookeeper::maxfilesize") %>
Expand Down

0 comments on commit d888a48

Please sign in to comment.