File tree 5 files changed +42
-0
lines changed
5 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ Sets the file that ntp configuration is written into.
120
120
121
121
Determines which template Puppet should use for the ntp configuration.
122
122
123
+ ####` disable_monitor `
124
+
125
+ Disables monitoring of ntp.
126
+
123
127
####` driftfile `
124
128
125
129
Sets the location of the drift file for ntp.
Original file line number Diff line number Diff line change 2
2
$autoupdate = $ntp::params::autoupdate,
3
3
$config = $ntp::params::config,
4
4
$config_template = $ntp::params::config_template,
5
+ $disable_monitor = $ntp::params::disable_monitor,
5
6
$driftfile = $ntp::params::driftfile,
6
7
$keys_enable = $ntp::params::keys_enable,
7
8
$keys_file = $ntp::params::keys_file,
23
24
24
25
validate_absolute_path($config )
25
26
validate_string($config_template )
27
+ validate_bool($disable_monitor )
26
28
validate_absolute_path($driftfile )
27
29
validate_bool($keys_enable )
28
30
validate_re($keys_controlkey , [' ^\d +$' , ' ' ])
Original file line number Diff line number Diff line change 2
2
3
3
$autoupdate = false
4
4
$config_template = ' ntp/ntp.conf.erb'
5
+ $disable_monitor = false
5
6
$keys_enable = false
6
7
$keys_controlkey = ' '
7
8
$keys_requestkey = ' '
Original file line number Diff line number Diff line change
1
+ require 'spec_helper_acceptance'
2
+
3
+ describe "ntp class with disable_monitor:" do
4
+ context 'should run successfully' do
5
+ pp = "class { 'ntp': disable_monitor => true }"
6
+
7
+ it 'runs twice' do
8
+ apply_manifest ( pp , :catch_failures => true )
9
+ apply_manifest ( pp , :catch_changes => true )
10
+ end
11
+
12
+ describe file ( '/etc/ntp.conf' ) do
13
+ it { should contain ( 'disable monitor' ) }
14
+ end
15
+ end
16
+
17
+ context 'should run successfully' do
18
+ pp = "class { 'ntp': disable_monitor => false }"
19
+
20
+ it 'runs twice' do
21
+ apply_manifest ( pp , :catch_failures => true )
22
+ apply_manifest ( pp , :catch_changes => true )
23
+ end
24
+
25
+ describe file ( '/etc/ntp.conf' ) do
26
+ it { should_not contain ( 'disable monitor' ) }
27
+ end
28
+ end
29
+
30
+ end
Original file line number Diff line number Diff line change 6
6
tinker panic 0
7
7
<% end -%>
8
8
9
+ <% if @disable_monitor == true -%>
10
+ disable monitor
11
+ <% end -%>
12
+
9
13
<% if @restrict != [] -%>
10
14
# Permit time synchronization with our time source, but do not'
11
15
# permit the source to query or modify the service on this system.'
@@ -40,4 +44,5 @@ requestkey <%= @keys_requestkey %>
40
44
<% if @keys_controlkey != '' -%>
41
45
controlkey <%= @keys_controlkey %>
42
46
<% end -%>
47
+
43
48
<% end -%>
You can’t perform that action at this time.
0 commit comments