From 05692fcf9285a935e7266075f2be9a94d5b1d3dd Mon Sep 17 00:00:00 2001 From: Bryan Jen Date: Fri, 13 Nov 2015 12:01:31 -0700 Subject: [PATCH] Defaults disable_monitor to true on all platforms. --- manifests/params.pp | 11 +---------- spec/classes/ntp_spec.rb | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index d558c6920..b0459eb43 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -20,6 +20,7 @@ $udlc_stratum = '10' $interfaces = [] $disable_auth = false + $disable_monitor = true $broadcastclient = false # Allow a list of fudge options @@ -64,7 +65,6 @@ '3.debian.pool.ntp.org', ] $maxpoll = undef - $disable_monitor = false } 'Debian': { $config = $default_config @@ -86,7 +86,6 @@ '3.debian.pool.ntp.org', ] $maxpoll = undef - $disable_monitor = false } 'RedHat': { $config = $default_config @@ -110,7 +109,6 @@ '2.fedora.pool.ntp.org', '3.fedora.pool.ntp.org', ] - $disable_monitor = true } default: { $restrict = [ @@ -125,7 +123,6 @@ '1.centos.pool.ntp.org', '2.centos.pool.ntp.org', ] - $disable_monitor = false } } } @@ -172,7 +169,6 @@ '3.opensuse.pool.ntp.org', ] $maxpoll = undef - $disable_monitor = false } 'FreeBSD': { $config = $default_config @@ -194,7 +190,6 @@ '3.freebsd.pool.ntp.org', ] $maxpoll = 9 - $disable_monitor = false } 'Archlinux': { $config = $default_config @@ -216,7 +211,6 @@ '3.arch.pool.ntp.org', ] $maxpoll = undef - $disable_monitor = false } 'Solaris': { $config = '/etc/inet/ntp.conf' @@ -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': { @@ -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. @@ -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.") diff --git a/spec/classes/ntp_spec.rb b/spec/classes/ntp_spec.rb index c8d50afa9..fd936fef3 100644 --- a/spec/classes/ntp_spec.rb +++ b/spec/classes/ntp_spec.rb @@ -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) {{