Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added the ability to modify logconfig with attributes

Signed-off-by: ericpaliotta <ericpaliotta217@gmail.com>
  • Loading branch information
ericpaliotta committed Jun 19, 2024
1 parent c332a3b commit d3b3251
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
default['ntp']['varlibdir'] = '/var/lib/ntp'
default['ntp']['driftfile'] = "#{node['ntp']['varlibdir']}/ntp.drift"
default['ntp']['logfile'] = nil
default['ntp']['logconfig'] = 'all'
default['ntp']['conffile'] = '/etc/ntp.conf'
default['ntp']['statsdir'] = '/var/log/ntpstats/'
default['ntp']['conf_owner'] = 'root'
Expand Down
4 changes: 4 additions & 0 deletions spec/unit/attributes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
expect(ntp['logfile']).to be nil
end

it 'sets the logconfig to all' do
expect(ntp['logconfig']).to eq('all')
end

it 'sets the conf file to /etc/ntp.conf' do
expect(ntp['conffile']).to eq('/etc/ntp.conf')
end
Expand Down
4 changes: 4 additions & 0 deletions templates/ntp.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ interface listen 127.0.0.1
<% end -%>
<% end -%>
<% unless node['ntp']['logconfig'].nil? -%>
logconfig =<%= node['ntp']['logconfig'] %>
<% end -%>
<% if node['ntp']['monitor'] -%>
enable monitor
<% else -%>
Expand Down

0 comments on commit d3b3251

Please sign in to comment.