Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SLES12 support as it has changed to Systemd #217

Merged
merged 2 commits into from
Oct 31, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'serverspec', :require => false
gem 'puppet-lint', :require => false
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
gem 'beaker-rspec','>=2.2.0', :require => false
gem 'pry', :require => false
gem 'simplecov', :require => false
end
Expand Down
15 changes: 10 additions & 5 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$udlc = false
$interfaces = []

# On virtual machines allow large clock skews.
# On virtual machines allow large clock skews.
$panic = str2bool($::is_virtual) ? {
true => false,
default => true,
Expand Down Expand Up @@ -87,6 +87,12 @@
]
}
'Suse': {
if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '12'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is causing the unit tests to fail. https://travis-ci.org/puppetlabs/puppetlabs-ntp/jobs/38836872

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in test cases

{
$service_name = 'ntpd'
} else{
$service_name = 'ntp'
}
$config = $default_config
$keys_file = $default_keys_file
$driftfile = '/var/lib/ntp/drift/ntp.drift'
Expand All @@ -97,7 +103,6 @@
'127.0.0.1',
'-6 ::1',
]
$service_name = 'ntp'
$iburst_enable = false
$servers = [
'0.opensuse.pool.ntp.org',
Expand Down Expand Up @@ -168,7 +173,7 @@
'3.pool.ntp.org',
]
}
# Gentoo was added as its own $::osfamily in Facter 1.7.0
# Gentoo was added as its own $::osfamily in Facter 1.7.0
'Gentoo': {
$config = $default_config
$keys_file = $default_keys_file
Expand All @@ -190,8 +195,8 @@
]
}
'Linux': {
# Account for distributions that don't have $::osfamily specific settings.
# Before Facter 1.7.0 Gentoo did not have its own $::osfamily
# Account for distributions that don't have $::osfamily specific settings.
# Before Facter 1.7.0 Gentoo did not have its own $::osfamily
case $::operatingsystem {
'Gentoo': {
$config = $default_config
Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/nodesets/sles-12-64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
HOSTS:
czriitzephrrlzw:
roles:
- master
- database
- dashboard
- agent
- default
platform: sles-12-x86_64
template: sles-12-x86_64
hypervisor: vcloud
CONFIG:
nfs_server: none
consoleport: 443
datastore: instance0
folder: Delivery/Quality Assurance/Enterprise/Dynamic
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
pooling_api: http://vcloud.delivery.puppetlabs.net/
pe_dir: http://enterprise.delivery.puppetlabs.net/3.4/preview
6 changes: 5 additions & 1 deletion spec/acceptance/ntp_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
packagename = 'service/network/ntp'
end
else
packagename = 'ntp'
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12'
servicename = 'ntpd'
else
servicename = 'ntp'
end
end

describe 'ntp::install class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
Expand Down
6 changes: 5 additions & 1 deletion spec/acceptance/ntp_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
packagename = 'service/network/ntp'
end
else
packagename = 'ntp'
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12'
servicename = 'ntpd'
else
servicename = 'ntp'
end
end

if (fact('osfamily') == 'Solaris')
Expand Down
20 changes: 12 additions & 8 deletions spec/acceptance/ntp_service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
require 'spec_helper_acceptance'

case fact('osfamily')
when 'RedHat', 'FreeBSD', 'Linux', 'Gentoo'
servicename = 'ntpd'
when 'Solaris'
servicename = 'network/ntp'
when 'AIX'
servicename = 'xntpd'
else
servicename = 'ntp'
when 'RedHat', 'FreeBSD', 'Linux', 'Gentoo'
servicename = 'ntpd'
when 'Solaris'
servicename = 'network/ntp'
when 'AIX'
servicename = 'xntpd'
else
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12'
servicename = 'ntpd'
else
servicename = 'ntp'
end
end

describe 'ntp::service class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
Expand Down
15 changes: 11 additions & 4 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
require 'beaker-rspec'

UNSUPPORTED_PLATFORMS = [ 'windows', 'Darwin' ]
UNSUPPORTED_PLATFORMS = ['windows', 'Darwin']

unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
# This will install the latest available package on el and deb based
# systems fail on windows and osx, and install via gem on other *nixes
foss_opts = { :default_action => 'gem_install' }
foss_opts = {:default_action => 'gem_install'}

if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
if default.is_pe?; then
install_pe;
else
install_puppet(foss_opts);
end

hosts.each do |host|
unless host.is_pe?
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] }
on host, apply_manifest('package{"git":ensure => present}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to fail on at least EL5 if you don't include EPEL. Why do we need to get stdlib from git?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of blasted Cert issues 👎

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add logic to do os specific if we really want to differentiate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the acceptance against Centos 5 and Puppet 3.7.2 and it ran beautifully, is it an older version that you are thinking might have issues with not having EPEL?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ergh, guess I forgot the images on vcloud were updated to include git :(

on host, 'git clone https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't be pulling stdlib master here ... we need to be sure that this module will still work on PE 3.2 and 3.3 that ships with stdlib3.

#on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]}
end
end

Expand All @@ -29,6 +35,7 @@
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
Expand Down