Skip to content

Commit 5a63a51

Browse files
author
Morgan Haskel
committed
Merge remote-tracking branch 'upstream/3.2.x' into test
2 parents a607bd4 + 177aebf commit 5a63a51

8 files changed

Lines changed: 72 additions & 26 deletions

File tree

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ group :development, :test do
66
gem 'puppetlabs_spec_helper', :require => false
77
gem 'serverspec', :require => false
88
gem 'puppet-lint', :require => false
9-
gem 'beaker', :require => false
10-
gem 'beaker-rspec', :require => false
9+
gem 'beaker-rspec','>=2.2.0', :require => false
1110
gem 'pry', :require => false
1211
gem 'simplecov', :require => false
1312
end

manifests/params.pp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$udlc = false
1717
$interfaces = []
1818

19-
# On virtual machines allow large clock skews.
19+
# On virtual machines allow large clock skews.
2020
$panic = str2bool($::is_virtual) ? {
2121
true => false,
2222
default => true,
@@ -87,6 +87,12 @@
8787
]
8888
}
8989
'Suse': {
90+
if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '12'
91+
{
92+
$service_name = 'ntpd'
93+
} else{
94+
$service_name = 'ntp'
95+
}
9096
$config = $default_config
9197
$keys_file = $default_keys_file
9298
$driftfile = '/var/lib/ntp/drift/ntp.drift'
@@ -97,7 +103,6 @@
97103
'127.0.0.1',
98104
'-6 ::1',
99105
]
100-
$service_name = 'ntp'
101106
$iburst_enable = false
102107
$servers = [
103108
'0.opensuse.pool.ntp.org',
@@ -168,7 +173,7 @@
168173
'3.pool.ntp.org',
169174
]
170175
}
171-
# Gentoo was added as its own $::osfamily in Facter 1.7.0
176+
# Gentoo was added as its own $::osfamily in Facter 1.7.0
172177
'Gentoo': {
173178
$config = $default_config
174179
$keys_file = $default_keys_file
@@ -190,8 +195,8 @@
190195
]
191196
}
192197
'Linux': {
193-
# Account for distributions that don't have $::osfamily specific settings.
194-
# Before Facter 1.7.0 Gentoo did not have its own $::osfamily
198+
# Account for distributions that don't have $::osfamily specific settings.
199+
# Before Facter 1.7.0 Gentoo did not have its own $::osfamily
195200
case $::operatingsystem {
196201
'Gentoo': {
197202
$config = $default_config
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
HOSTS:
3+
czriitzephrrlzw:
4+
roles:
5+
- master
6+
- database
7+
- dashboard
8+
- agent
9+
- default
10+
platform: sles-12-x86_64
11+
template: sles-12-x86_64
12+
hypervisor: vcloud
13+
CONFIG:
14+
nfs_server: none
15+
consoleport: 443
16+
datastore: instance0
17+
folder: Delivery/Quality Assurance/Enterprise/Dynamic
18+
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
19+
pooling_api: http://vcloud.delivery.puppetlabs.net/
20+
pe_dir: http://enterprise.delivery.puppetlabs.net/3.4/preview

spec/acceptance/ntp_install_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
packagename = 'service/network/ntp'
2323
end
2424
else
25-
packagename = 'ntp'
25+
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12'
26+
servicename = 'ntpd'
27+
else
28+
servicename = 'ntp'
29+
end
2630
end
2731

2832
describe 'ntp::install class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do

spec/acceptance/ntp_parameters_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
packagename = 'service/network/ntp'
2323
end
2424
else
25-
packagename = 'ntp'
25+
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12'
26+
servicename = 'ntpd'
27+
else
28+
servicename = 'ntp'
29+
end
2630
end
2731

2832
if (fact('osfamily') == 'Solaris')

spec/acceptance/ntp_service_spec.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
require 'spec_helper_acceptance'
22

33
case fact('osfamily')
4-
when 'RedHat', 'FreeBSD', 'Linux', 'Gentoo'
5-
servicename = 'ntpd'
6-
when 'Solaris'
7-
servicename = 'network/ntp'
8-
when 'AIX'
9-
servicename = 'xntpd'
10-
else
11-
servicename = 'ntp'
4+
when 'RedHat', 'FreeBSD', 'Linux', 'Gentoo'
5+
servicename = 'ntpd'
6+
when 'Solaris'
7+
servicename = 'network/ntp'
8+
when 'AIX'
9+
servicename = 'xntpd'
10+
else
11+
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12'
12+
servicename = 'ntpd'
13+
else
14+
servicename = 'ntp'
15+
end
1216
end
1317

1418
describe 'ntp::service class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do

spec/classes/ntp_spec.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
let :facts do
1010
super().merge({ :osfamily => 'Linux', :operatingsystem => 'Gentoo' })
1111
end
12+
elsif system == 'Suse'
13+
let :facts do
14+
super().merge({ :osfamily => system,:operatingsystem => 'SLES',:operatingsystemmajrelease => '11' })
15+
end
1216
else
1317
let :facts do
1418
super().merge({ :osfamily => system })
@@ -214,19 +218,19 @@
214218
:servers => ['a', 'b', 'c', 'd'],
215219
:logfile => '/var/log/foobar.log',
216220
}}
217-
221+
218222
it 'should contain logfile setting' do
219223
should contain_file('/etc/ntp.conf').with({
220224
'content' => /^logfile = \/var\/log\/foobar\.log\n/,
221225
})
222226
end
223227
end
224-
228+
225229
context 'when set to false' do
226230
let(:params) {{
227231
:servers => ['a', 'b', 'c', 'd'],
228232
}}
229-
233+
230234
it 'should not contain a logfile line' do
231235
should_not contain_file('/etc/ntp.conf').with({
232236
'content' => /logfile =/,
@@ -289,13 +293,13 @@
289293

290294
describe "on osfamily Suse" do
291295
let :facts do
292-
super().merge({ :osfamily => 'Suse' })
296+
super().merge({ :osfamily => 'Suse', :operatingsystem => 'SLES',:operatingsystemmajrelease => '11' })
293297
end
294298

295299
it 'uses the opensuse ntp servers by default' do
296300
should contain_file('/etc/ntp.conf').with({
297301
'content' => /server \d.opensuse.pool.ntp.org/,
298-
})
302+
})
299303
end
300304
end
301305

spec/spec_helper_acceptance.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
require 'beaker-rspec'
22

3-
UNSUPPORTED_PLATFORMS = [ 'windows', 'Darwin' ]
3+
UNSUPPORTED_PLATFORMS = ['windows', 'Darwin']
44

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

10-
if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
10+
if default.is_pe?; then
11+
install_pe;
12+
else
13+
install_puppet(foss_opts);
14+
end
1115

1216
hosts.each do |host|
1317
unless host.is_pe?
1418
on host, "/bin/echo '' > #{host['hieraconf']}"
1519
end
1620
on host, "mkdir -p #{host['distmoduledir']}"
17-
on host, puppet('module install puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
21+
on host, apply_manifest('package{"git":ensure => present}')
22+
on host, 'git clone -b 3.2.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib'
1823
end
1924
end
2025

@@ -29,6 +34,7 @@
2934
c.before :suite do
3035
hosts.each do |host|
3136
on host, "mkdir -p #{host['distmoduledir']}/ntp"
37+
on host, puppet('module install puppetlabs-stdlib')
3238
%w(lib manifests templates metadata.json).each do |file|
3339
scp_to host, "#{proj_root}/#{file}", "#{host['distmoduledir']}/ntp"
3440
end

0 commit comments

Comments
 (0)