Skip to content

Commit

Permalink
Merge pull request #1 from puppetlabs/modules-2315
Browse files Browse the repository at this point in the history
Defaults disable_monitor to true on all platforms.
  • Loading branch information
hunner committed Nov 13, 2015
2 parents 5774e6b + 05692fc commit 4d69d9b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
11 changes: 1 addition & 10 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
$udlc_stratum = '10'
$interfaces = []
$disable_auth = false
$disable_monitor = true
$broadcastclient = false

# Allow a list of fudge options
Expand Down Expand Up @@ -64,7 +65,6 @@
'3.debian.pool.ntp.org',
]
$maxpoll = undef
$disable_monitor = false
}
'Debian': {
$config = $default_config
Expand All @@ -86,7 +86,6 @@
'3.debian.pool.ntp.org',
]
$maxpoll = undef
$disable_monitor = false
}
'RedHat': {
$config = $default_config
Expand All @@ -110,7 +109,6 @@
'2.fedora.pool.ntp.org',
'3.fedora.pool.ntp.org',
]
$disable_monitor = true
}
default: {
$restrict = [
Expand All @@ -125,7 +123,6 @@
'1.centos.pool.ntp.org',
'2.centos.pool.ntp.org',
]
$disable_monitor = false
}
}
}
Expand Down Expand Up @@ -172,7 +169,6 @@
'3.opensuse.pool.ntp.org',
]
$maxpoll = undef
$disable_monitor = false
}
'FreeBSD': {
$config = $default_config
Expand All @@ -194,7 +190,6 @@
'3.freebsd.pool.ntp.org',
]
$maxpoll = 9
$disable_monitor = false
}
'Archlinux': {
$config = $default_config
Expand All @@ -216,7 +211,6 @@
'3.arch.pool.ntp.org',
]
$maxpoll = undef
$disable_monitor = false
}
'Solaris': {
$config = '/etc/inet/ntp.conf'
Expand Down Expand Up @@ -249,7 +243,6 @@
'3.pool.ntp.org',
]
$maxpoll = undef
$disable_monitor = false
}
# Gentoo was added as its own $::osfamily in Facter 1.7.0
'Gentoo': {
Expand All @@ -272,7 +265,6 @@
'3.gentoo.pool.ntp.org',
]
$maxpoll = undef
$disable_monitor = false
}
'Linux': {
# Account for distributions that don't have $::osfamily specific settings.
Expand All @@ -298,7 +290,6 @@
'3.gentoo.pool.ntp.org',
]
$maxpoll = undef
$disable_monitor = false
}
default: {
fail("The ${module_name} module is not supported on an ${::operatingsystem} distribution.")
Expand Down
34 changes: 34 additions & 0 deletions spec/classes/ntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,40 @@
end
end
end
describe 'with parameter disable_monitor' do
context 'default' do
let(:params) {{
}}

it 'should contain disable monitor setting' do
should contain_file('/etc/ntp.conf').with({
'content' => /^disable monitor\n/,
})
end
end
context 'when set to true' do
let(:params) {{
:disable_monitor => true,
}}

it 'should contain disable monitor setting' do
should contain_file('/etc/ntp.conf').with({
'content' => /^disable monitor\n/,
})
end
end
context 'when set to false' do
let(:params) {{
:disable_monitor => false,
}}

it 'should not contain disable monitor setting' do
should_not contain_file('/etc/ntp.conf').with({
'content' => /^disable monitor\n/,
})
end
end
end
describe 'with parameter broadcastclient' do
context 'when set to true' do
let(:params) {{
Expand Down

0 comments on commit 4d69d9b

Please sign in to comment.