From d5ee1acc46e3dd3ac6a4da065ca29e43e451d8d2 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 9 Sep 2014 14:38:39 -0400 Subject: [PATCH 1/9] 3.2.0 prep --- CHANGELOG.md | 17 +++++++++++++++++ metadata.json | 11 ++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b3d3881..91d746c5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +##2014-09-10 - Supported Release 3.2.0 +###Summary + +This is primarily a feature release. It adds a few new parameters to class `ntp` +and adds support for Solaris 10 and 11. + +####Features +- Add the `$interfaces` parameter to `ntp` +- Add support for Solaris 10 and 11 +- Synchronized files with modulesync +- Test updates +- Add the `$iburst_enable` parameter to `ntp` + +####Bugfixes +- Fixes for strict variables +- Remove dependency on stdlib4 + ##2014-06-06 - Release 3.1.2 ###Summary diff --git a/metadata.json b/metadata.json index 70051b838..2c268a221 100644 --- a/metadata.json +++ b/metadata.json @@ -1,11 +1,11 @@ { "name": "puppetlabs-ntp", - "version": "3.1.2", + "version": "3.2.0", "author": "Puppet Labs", "summary": "NTP Module", "license": "Apache Version 2.0", - "source": "git://github.com/puppetlabs/puppetlabs-ntp", - "project_page": "http://github.com/puppetlabs/puppetlabs-ntp", + "source": "https://github.com/puppetlabs/puppetlabs-ntp", + "project_page": "https://github.com/puppetlabs/puppetlabs-ntp", "issues_url": "https://tickets.puppetlabs.com/browse/MODULES", "operatingsystem_support": [ { @@ -86,9 +86,6 @@ ], "description": "NTP Module for Debian, Ubuntu, CentOS, RHEL, OEL, Fedora, FreeBSD, ArchLinux and Gentoo.", "dependencies": [ - { - "name": "puppetlabs/stdlib", - "version_requirement": ">= 3.2.0 < 5.0.0" - } + {"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"} ] } From 5c9cb4f0e692f7659133e0777c9334978565d0d5 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Fri, 12 Sep 2014 16:11:05 -0400 Subject: [PATCH 2/9] Switch over to using puppet_module_install_on() This makes sure the path is correct for Solaris. --- spec/spec_helper_acceptance.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index ccc8915b9..53c7ffbfe 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -14,7 +14,7 @@ on host, "/bin/echo '' > #{host['hieraconf']}" end on host, "mkdir -p #{host['distmoduledir']}" - on host, 'puppet module install puppetlabs-stdlib', :acceptable_exit_codes => [0,1] + puppet_module_install_on(host, :module_name => 'puppetlabs-stdlib') end end From b71c18e8ed8d3b6865c9fb1ba14aab6053715102 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 15 Sep 2014 13:26:35 -0700 Subject: [PATCH 3/9] Test fixes for Solaris --- spec/acceptance/disable_monitoring_spec.rb | 14 ++++++--- spec/acceptance/ntp_config_spec.rb | 10 ++++-- spec/acceptance/ntp_parameters_spec.rb | 36 +++++++++++++--------- spec/acceptance/preferred_servers_spec.rb | 12 ++++++-- spec/acceptance/restrict_spec.rb | 10 ++++-- 5 files changed, 56 insertions(+), 26 deletions(-) diff --git a/spec/acceptance/disable_monitoring_spec.rb b/spec/acceptance/disable_monitoring_spec.rb index 709010b0a..e86c9b80c 100644 --- a/spec/acceptance/disable_monitoring_spec.rb +++ b/spec/acceptance/disable_monitoring_spec.rb @@ -1,5 +1,11 @@ require 'spec_helper_acceptance' +if (fact('osfamily') == 'Solaris') + config = '/etc/inet/ntp.conf' +else + config = '/etc/ntp.conf' +end + describe "ntp class with disable_monitor:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'should run successfully' do pp = "class { 'ntp': disable_monitor => true }" @@ -9,8 +15,8 @@ apply_manifest(pp, :catch_changes => true) end - describe file('/etc/ntp.conf') do - it { should contain('disable monitor') } + describe file("#{config}") do + its(:content) { should match('disable monitor') } end end @@ -22,8 +28,8 @@ apply_manifest(pp, :catch_changes => true) end - describe file('/etc/ntp.conf') do - it { should_not contain('disable monitor') } + describe file("#{config}") do + its(:content) { should_not match('disable monitor') } end end diff --git a/spec/acceptance/ntp_config_spec.rb b/spec/acceptance/ntp_config_spec.rb index e30e5770d..48c89af7e 100644 --- a/spec/acceptance/ntp_config_spec.rb +++ b/spec/acceptance/ntp_config_spec.rb @@ -24,6 +24,12 @@ line = '0.debian.pool.ntp.org iburst' end +if (fact('osfamily') == 'Solaris') + config = '/etc/inet/ntp.conf' +else + config = '/etc/ntp.conf' +end + describe 'ntp::config class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'sets up ntp.conf' do apply_manifest(%{ @@ -31,8 +37,8 @@ class { 'ntp': } }, :catch_failures => true) end - describe file('/etc/ntp.conf') do + describe file("#{config}") do it { should be_file } - it { should contain line } + its(:content) { should match line } end end diff --git a/spec/acceptance/ntp_parameters_spec.rb b/spec/acceptance/ntp_parameters_spec.rb index 124d3f671..675cf81e4 100644 --- a/spec/acceptance/ntp_parameters_spec.rb +++ b/spec/acceptance/ntp_parameters_spec.rb @@ -25,6 +25,12 @@ packagename = 'ntp' end +if (fact('osfamily') == 'Solaris') + config = '/etc/inet/ntp.conf' +else + config = '/etc/ntp.conf' +end + describe "ntp class:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'applies successfully' do pp = "class { 'ntp': }" @@ -67,9 +73,9 @@ apply_manifest(pp, :catch_failures => true) end - describe file('/etc/ntp.conf') do + describe file("#{config}") do it { should be_file } - it { should contain 'testcontent' } + its(:content) { should match 'testcontent' } end end @@ -79,9 +85,9 @@ apply_manifest(pp, :catch_failures => true) end - describe file('/etc/ntp.conf') do + describe file("#{config}") do it { should be_file } - it { should contain 'driftfile /tmp/driftfile' } + its(:content) { should match 'driftfile /tmp/driftfile' } end end @@ -102,12 +108,12 @@ class { 'ntp': apply_manifest(pp, :catch_failures => true) end - describe file('/etc/ntp.conf') do + describe file("#{config}") do it { should be_file } - it { should contain 'keys /etc/ntp/keys' } - it { should contain 'controlkey /etc/ntp/controlkey' } - it { should contain 'requestkey 1' } - it { should contain 'trustedkey 1 2' } + its(:content) { should match 'keys /etc/ntp/keys' } + its(:content) { should match 'controlkey /etc/ntp/controlkey' } + its(:content) { should match 'requestkey 1' } + its(:content) { should match 'trustedkey 1 2' } end end @@ -139,8 +145,8 @@ class { 'ntp': apply_manifest(pp, :catch_failures => true) end - describe file('/etc/ntp.conf') do - it { should contain 'tinker panic' } + describe file("#{config}") do + its(:content) { should match 'tinker panic' } end end @@ -154,8 +160,8 @@ class { 'ntp': apply_manifest(pp, :catch_failures => true) end - describe file('/etc/ntp.conf') do - it { should_not contain 'tinker panic 0' } + describe file("#{config}") do + its(:content) { should_not match 'tinker panic 0' } end end @@ -165,9 +171,9 @@ class { 'ntp': apply_manifest(pp, :catch_failures => true) end - describe file('/etc/ntp.conf') do + describe file("#{config}") do it { should be_file } - it { should contain '127.127.1.0' } + its(:content) { should match '127.127.1.0' } end end diff --git a/spec/acceptance/preferred_servers_spec.rb b/spec/acceptance/preferred_servers_spec.rb index 352d5cc44..072752721 100644 --- a/spec/acceptance/preferred_servers_spec.rb +++ b/spec/acceptance/preferred_servers_spec.rb @@ -1,5 +1,11 @@ require 'spec_helper_acceptance' +if (fact('osfamily') == 'Solaris') + config = '/etc/inet/ntp.conf' +else + config = '/etc/ntp.conf' +end + describe 'preferred servers', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do pp = <<-EOS class { '::ntp': @@ -14,10 +20,10 @@ class { '::ntp': end end - describe file('/etc/ntp.conf') do + describe file("#{config}") do it { should be_file } - it { should contain 'server a' } - it { should contain 'server b' } + its(:content) { should match 'server a' } + its(:content) { should match 'server b' } its(:content) { should match /server c (iburst\s|)prefer/ } its(:content) { should match /server d (iburst\s|)prefer/ } end diff --git a/spec/acceptance/restrict_spec.rb b/spec/acceptance/restrict_spec.rb index 15fc2f74f..b919a6b2a 100644 --- a/spec/acceptance/restrict_spec.rb +++ b/spec/acceptance/restrict_spec.rb @@ -1,5 +1,11 @@ require 'spec_helper_acceptance' +if (fact('osfamily') == 'Solaris') + config = '/etc/inet/ntp.conf' +else + config = '/etc/ntp.conf' +end + describe "ntp class with restrict:", :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do context 'should run successfully' do it 'runs twice' do @@ -12,8 +18,8 @@ end end - describe file('/etc/ntp.conf') do - it { should contain('test restrict') } + describe file("#{config}") do + its(:content) { should match('test restrict') } end end From 40b54f297771960c682c060ab6e5914f6d4057ac Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Mon, 15 Sep 2014 16:03:01 -0700 Subject: [PATCH 4/9] Get rid of some extra whitespace in the template --- templates/ntp.conf.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/ntp.conf.erb b/templates/ntp.conf.erb index ff40fe603..99f43d7e0 100644 --- a/templates/ntp.conf.erb +++ b/templates/ntp.conf.erb @@ -15,7 +15,7 @@ disable monitor # permit the source to query or modify the service on this system. <% @restrict.flatten.each do |restrict| -%> restrict <%= restrict %> -<% end %> +<% end -%> <% end -%> <% if @interfaces != [] -%> @@ -24,7 +24,7 @@ restrict <%= restrict %> interface ignore wildcard <% @interfaces.flatten.each do |interface| -%> interface listen <%= interface %> -<% end %> +<% end -%> <% end -%> <% [@servers].flatten.each do |server| -%> @@ -42,10 +42,10 @@ restrict 127.127.1.0 # Driftfile. driftfile <%= @driftfile %> -<% unless @logfile.nil? %> +<% unless @logfile.nil? -%> # Logfile logfile = <%= @logfile %> -<% end %> +<% end -%> <% if @keys_enable -%> keys <%= @keys_file %> From 315a73bc8f299b261eca38404102df29a968b5d4 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 16 Sep 2014 10:21:08 -0700 Subject: [PATCH 5/9] Use scp to install the module This gets around SSL issues on Solaris10. --- spec/spec_helper_acceptance.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 53c7ffbfe..e830e7fee 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -27,7 +27,11 @@ # Configure all nodes in nodeset c.before :suite do - # Install module - puppet_module_install(:source => proj_root, :module_name => 'ntp') + hosts.each do |host| + on host, "mkdir -p #{host['distmoduledir']}/ntp" + %w(lib manifests templates metadata.json).each do |file| + scp_to host, "#{proj_root}/#{file}", "#{host['distmoduledir']}/ntp" + end + end end end From 2d81a2c9b52d63f130bd1a5072b22dcf61c8a633 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 16 Sep 2014 10:59:21 -0700 Subject: [PATCH 6/9] Fix for Suse osfamily Capitalization was wrong which was causing test failures --- manifests/params.pp | 2 +- spec/acceptance/ntp_config_spec.rb | 2 +- spec/classes/ntp_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index fa4766d01..a3cde9ea5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -86,7 +86,7 @@ '2.centos.pool.ntp.org', ] } - 'SuSE': { + 'Suse': { $config = $default_config $keys_file = $default_keys_file $driftfile = '/var/lib/ntp/drift/ntp.drift' diff --git a/spec/acceptance/ntp_config_spec.rb b/spec/acceptance/ntp_config_spec.rb index 48c89af7e..689ba8e6c 100644 --- a/spec/acceptance/ntp_config_spec.rb +++ b/spec/acceptance/ntp_config_spec.rb @@ -7,7 +7,7 @@ line = '0.debian.pool.ntp.org iburst' when 'RedHat' line = '0.centos.pool.ntp.org' -when 'SuSE' +when 'Suse' line = '0.opensuse.pool.ntp.org' when 'Gentoo' line = '0.gentoo.pool.ntp.org' diff --git a/spec/classes/ntp_spec.rb b/spec/classes/ntp_spec.rb index 4a9fd44f9..809bc12f5 100644 --- a/spec/classes/ntp_spec.rb +++ b/spec/classes/ntp_spec.rb @@ -3,7 +3,7 @@ describe 'ntp' do let(:facts) {{ :is_virtual => 'false' }} - ['Debian', 'RedHat','SuSE', 'FreeBSD', 'Archlinux', 'Gentoo', 'Gentoo (Facter < 1.7)'].each do |system| + ['Debian', 'RedHat','Suse', 'FreeBSD', 'Archlinux', 'Gentoo', 'Gentoo (Facter < 1.7)'].each do |system| context "when on system #{system}" do if system == 'Gentoo (Facter < 1.7)' let :facts do @@ -287,9 +287,9 @@ end end - describe "on osfamily SuSE" do + describe "on osfamily Suse" do let :facts do - super().merge({ :osfamily => 'SuSE' }) + super().merge({ :osfamily => 'Suse' }) end it 'uses the opensuse ntp servers by default' do From be17aeedc67837c55e511d9353d7a51175003d8f Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 16 Sep 2014 11:36:41 -0700 Subject: [PATCH 7/9] Missed interfaces parameter in the README. --- README.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.markdown b/README.markdown index 88cf34a11..94d8ab81f 100644 --- a/README.markdown +++ b/README.markdown @@ -143,6 +143,10 @@ Sets the location of the drift file for ntp. Set the iburst option in the ntp configuration. If enabled the option is set for every ntp peer. +####`interfaces` + +Sets the list of interfaces NTP will listen on. This parameter must be an array. + ####`keys_controlkey` The key to use as the control key. From 0881cc26b1140873534dc69fdbe9b35d8d27d435 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 16 Sep 2014 11:47:18 -0700 Subject: [PATCH 8/9] Use puppet('module install puppetlabs-stdlib') We need to be able to pass a block to this since the stdlib install fails sometime on PE (which is ok, since it's included) --- spec/spec_helper_acceptance.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index e830e7fee..07c47c601 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -14,7 +14,7 @@ on host, "/bin/echo '' > #{host['hieraconf']}" end on host, "mkdir -p #{host['distmoduledir']}" - puppet_module_install_on(host, :module_name => 'puppetlabs-stdlib') + on host, puppet('module install puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } end end From e4b60a4a49b9e0efbda2f9b655818a21adff3c4b Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 16 Sep 2014 15:07:22 -0700 Subject: [PATCH 9/9] Doesn't work on sol10 --- CHANGELOG.md | 2 +- README.markdown | 2 +- metadata.json | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d746c5f..a0e0d6b09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ###Summary This is primarily a feature release. It adds a few new parameters to class `ntp` -and adds support for Solaris 10 and 11. +and adds support for Solaris 11. ####Features - Add the `$interfaces` parameter to `ntp` diff --git a/README.markdown b/README.markdown index 94d8ab81f..630d70dd6 100644 --- a/README.markdown +++ b/README.markdown @@ -229,7 +229,7 @@ The module has been tested on: * Gentoo * Arch Linux * FreeBSD -* Solaris 10, 11 +* Solaris 11 * AIX 5.3, 6.1, 7.1 Testing on other platforms has been light and cannot be guaranteed. diff --git a/metadata.json b/metadata.json index 2c268a221..48fdafde2 100644 --- a/metadata.json +++ b/metadata.json @@ -61,7 +61,6 @@ { "operatingsystem": "Solaris", "operatingsystemrelease": [ - "10", "11" ] },