From ca7be1d52ef74919e21475b48e1ce2c6a3a916fa Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Fri, 31 Oct 2014 15:10:15 -0700 Subject: [PATCH 1/5] 3.3.0 prep --- CHANGELOG.md | 8 ++++++++ metadata.json | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1822b913d..00dee7398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +##2014-11-04 - Supported Release 3.3.0 +###Summary + +This release adds support for SLES 12. + +####Features +- Added support for SLES 12 + ##2014-10-02 - Supported Release 3.2.1 ###Summary diff --git a/metadata.json b/metadata.json index 29fa46d56..73c31cd2e 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-ntp", - "version": "3.2.1", + "version": "3.3.0", "author": "Puppet Labs", "summary": "NTP Module", "license": "Apache Version 2.0", @@ -43,7 +43,9 @@ { "operatingsystem": "SLES", "operatingsystemrelease": [ - "11 SP1" + "10 SP4", + "11 SP1", + "12" ] }, { From 9753f95cc83bf5c455d6a5ae61f7da4c76b53868 Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Tue, 4 Nov 2014 13:09:58 -0800 Subject: [PATCH 2/5] Updated testing and support for sles12 --- manifests/params.pp | 3 +- spec/acceptance/ntp_service_spec.rb | 54 ++++++++++++++++++++--------- spec/spec_helper_acceptance.rb | 8 +++-- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 500c982ef..f959b2e3d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -90,11 +90,12 @@ if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '12' { $service_name = 'ntpd' + $keys_file = '/etc/ntp.keys' } else{ $service_name = 'ntp' + $keys_file = $default_keys_file } $config = $default_config - $keys_file = $default_keys_file $driftfile = '/var/lib/ntp/drift/ntp.drift' $package_name = $default_package_name $restrict = [ diff --git a/spec/acceptance/ntp_service_spec.rb b/spec/acceptance/ntp_service_spec.rb index 7851bd07c..73edd656d 100644 --- a/spec/acceptance/ntp_service_spec.rb +++ b/spec/acceptance/ntp_service_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper_acceptance' +require 'specinfra' case fact('osfamily') when 'RedHat', 'FreeBSD', 'Linux', 'Gentoo' @@ -14,7 +15,21 @@ servicename = 'ntp' end end - +shared_examples 'running' do + describe service(servicename) do + if !(fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12') + it { should be_running } + it { should be_enabled } + else + # hack until we either update SpecInfra or come up with alternative + it { + output = shell('service ntpd status') + expect(output.stdout).to match(/Active\:\s+active\s+\(running\)/) + expect(output.stdout).to match(/^\s+Loaded.*enabled\)$/) + } + end + end +end describe 'ntp::service class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do describe 'basic test' do it 'sets up the service' do @@ -23,10 +38,7 @@ class { 'ntp': } }, :catch_failures => true) end - describe service(servicename) do - it { should be_enabled } - it { should be_running } - end + it_should_behave_like 'running' end describe 'service parameters' do @@ -41,29 +53,37 @@ class { 'ntp': EOS apply_manifest(pp, :catch_failures => true) end - - describe service(servicename) do - it { should be_running } - it { should be_enabled } - end + it_should_behave_like 'running' end +end - describe 'service is unmanaged' do - it 'shouldnt stop the service' do - pp = <<-EOS +describe 'service is unmanaged' do + it 'shouldnt stop the service' do + pp = <<-EOS class { 'ntp': service_enable => false, service_ensure => stopped, service_manage => false, service_name => '#{servicename}' } - EOS - apply_manifest(pp, :catch_failures => true) - end + EOS + apply_manifest(pp, :catch_failures => true) + end - describe service(servicename) do + describe service(servicename) do + if !(fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12') it { should be_running } it { should be_enabled } + else + # hack until we either update SpecInfra or come up with alternative + output = shell('service ntpd status', :acceptable_exit_codes => [0, 3]) + it 'should be disabled' do + expect(output.stdout).to match(/^\s+Loaded.*disabled\)$/) + end + it 'should be stopped' do + expect(output.stdout).to match(/Active\:\s+inactive/) + end end end end + diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 3f5e41061..e130db60c 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -18,8 +18,12 @@ on host, "/bin/echo '' > #{host['hieraconf']}" end on host, "mkdir -p #{host['distmoduledir']}" - on host, apply_manifest('package{"git":ensure => present}') - on host, 'git clone -b 3.2.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib' + if host['platform'] =~ /sles-12/ + apply_manifest_on(host, 'package{"git":}') + on host, 'git clone -b 4.3.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib' + else + on host, puppet_module_install('puppetlabs/stdlib') + end end end From fa30e141512b76bdb21a075e7893796b9ebed5e6 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 4 Nov 2014 13:49:34 -0800 Subject: [PATCH 3/5] Limitations was out of date. --- README.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.markdown b/README.markdown index 630d70dd6..8aadb6b64 100644 --- a/README.markdown +++ b/README.markdown @@ -218,19 +218,19 @@ status as a virtual machine. ##Limitations -This module has been built on and tested against Puppet 2.7 and higher. +This module has been built on and tested against Puppet 3. The module has been tested on: -* RedHat Enterprise Linux 5/6 +* RedHat Enterprise Linux 5/6/7 +* CentOS 5/6/7 +* Oracle Enterprise Linux 5/6/7 +* Scientific Linux 5/6/7 +* SLES 10SP4/11SP1/12 * Debian 6/7 -* CentOS 5/6 -* Ubuntu 12.04 -* Gentoo -* Arch Linux -* FreeBSD +* Ubuntu 10.04/12.04/14.04 * Solaris 11 -* AIX 5.3, 6.1, 7.1 +* AIX 5.3/6.1/7.1 Testing on other platforms has been light and cannot be guaranteed. From 0718d95ebcc3e3c6c28a32c79428a7deaaf45dc6 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 4 Nov 2014 14:09:52 -0800 Subject: [PATCH 4/5] stdlib installation wasn't working --- spec/spec_helper_acceptance.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index e130db60c..51ab4417f 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -22,7 +22,7 @@ apply_manifest_on(host, 'package{"git":}') on host, 'git clone -b 4.3.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib' else - on host, puppet_module_install('puppetlabs/stdlib') + on host, puppet('module install puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } end end end @@ -38,7 +38,6 @@ c.before :suite do hosts.each do |host| on host, "mkdir -p #{host['distmoduledir']}/ntp" - on host, puppet('module install puppetlabs-stdlib') %w(lib manifests templates metadata.json).each do |file| scp_to host, "#{proj_root}/#{file}", "#{host['distmoduledir']}/ntp" end From f31b1956d7d87b6dc73f5a672ecade5d4a82a704 Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Tue, 4 Nov 2014 16:01:18 -0800 Subject: [PATCH 5/5] add support for solaris given the ssl cert issue --- spec/spec_helper_acceptance.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 51ab4417f..1a4bea19a 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -18,11 +18,11 @@ on host, "/bin/echo '' > #{host['hieraconf']}" end on host, "mkdir -p #{host['distmoduledir']}" - if host['platform'] =~ /sles-12/ + if host['platform'] =~ /sles-12/i || host['platform'] =~ /solaris-11/i apply_manifest_on(host, 'package{"git":}') on host, 'git clone -b 4.3.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib' else - on host, puppet('module install puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } + on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]} end end end