Skip to content

Commit

Permalink
[GH-250] (#251)
Browse files Browse the repository at this point in the history
Added capability to set logconfig using an attribute

Signed-off-by: ericpaliotta <[email protected]>
  • Loading branch information
ericpaliotta authored Jul 15, 2024
1 parent c332a3b commit a7e23b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Standardise files with files in sous-chefs/repo-management

Standardise files with files in sous-chefs/repo-management

Added capability to set logconfig using an attribute

## 5.1.2 - *2024-05-02*

## 5.1.1 - *2024-05-02*
Expand Down
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 a7e23b8

Please sign in to comment.