Skip to content

Commit ee1105b

Browse files
committed
Merge pull request redhat-openstack#283 from DavidS/fix-ci-for-pe-next
Fix CI for PE.next
2 parents 8e763ef + 2a5b0ca commit ee1105b

2 files changed

Lines changed: 44 additions & 16 deletions

File tree

manifests/params.pp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,34 @@
130130
}
131131
}
132132
'Suse': {
133-
if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '12'
134-
{
135-
$service_name = 'ntpd'
136-
$keys_file = '/etc/ntp.keys'
137-
} else{
133+
if $::operatingsystem == 'SLES' {
134+
case $::operatingsystemmajrelease {
135+
'10': {
136+
$service_name = 'ntp'
137+
$keys_file = '/etc/ntp.keys'
138+
$package_name = [ 'xntp' ]
139+
}
140+
'11': {
141+
$service_name = 'ntp'
142+
$keys_file = $default_keys_file
143+
$package_name = $default_package_name
144+
}
145+
'12': {
146+
$service_name = 'ntpd'
147+
$keys_file = '/etc/ntp.keys'
148+
$package_name = $default_package_name
149+
}
150+
default: {
151+
fail("The ${module_name} module is not supported on an ${::operatingsystem} ${::operatingsystemmajrelease} distribution.")
152+
}
153+
}
154+
} else {
138155
$service_name = 'ntp'
139156
$keys_file = $default_keys_file
157+
$package_name = $default_package_name
140158
}
141159
$config = $default_config
142160
$driftfile = '/var/lib/ntp/drift/ntp.drift'
143-
$package_name = $default_package_name
144161
$restrict = [
145162
'default kod nomodify notrap nopeer noquery',
146163
'-6 default kod nomodify notrap nopeer noquery',

spec/spec_helper_acceptance.rb

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,30 @@
88
run_puppet_install_helper
99

1010
hosts.each do |host|
11-
if host['platform'] =~ /sles-12/i || host['platform'] =~ /solaris-11/i
12-
apply_manifest_on(host, 'package{"git":}')
13-
on host, 'git clone -b 4.6.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib'
11+
# Solaris 11 doesn't ship the SSL CA root for the forgeapi server
12+
# therefore we need to use a different way to deploy the module to
13+
# the host
14+
if host['platform'] =~ /solaris-11/i
15+
apply_manifest_on(host, 'package { "git": }')
16+
# PE 3.x and 2015.2 require different locations to install modules
17+
modulepath = host.puppet['modulepath']
18+
modulepath = modulepath.split(':').first if modulepath
19+
20+
environmentpath = host.puppet['environmentpath']
21+
environmentpath = environmentpath.split(':').first if environmentpath
22+
23+
destdir = modulepath || "#{environmentpath}/production/modules"
24+
on host, "git clone -b 4.6.0 https://github.com/puppetlabs/puppetlabs-stdlib #{destdir}/stdlib"
1425
else
15-
on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]}
26+
on host, puppet('module install puppetlabs-stdlib')
1627
end
1728

18-
#Need to disable update of ntp servers from DHCP, as subsequent restart of ntp causes test failures
19-
if fact('osfamily') == 'Debian'
20-
shell('[[ -f /etc/dhcp/dhclient-exit-hooks.d/ntp ]] && rm /etc/dhcp/dhcp-exit-hooks.d/ntp', { :acceptable_exit_codes => [0, 1] })
21-
shell('[[ -f /etc/dhcp3/dhclient-exit-hooks.d/ntp ]] && rm /etc/dhcp3/dhcp-exit-hooks.d/ntp', { :acceptable_exit_codes => [0, 1] })
22-
elsif fact('osfamily') == 'RedHat'
23-
shell('echo "PEERNTP=no" >> /etc/sysconfig/network', { :acceptable_exit_codes => [0, 1]})
29+
# Need to disable update of ntp servers from DHCP, as subsequent restart of ntp causes test failures
30+
if fact_on(host, 'osfamily') == 'Debian'
31+
on host, 'dpkg-divert --divert /etc/dhcp-ntp.bak --local --rename --add /etc/dhcp/dhclient-exit-hooks.d/ntp'
32+
on host, 'dpkg-divert --divert /etc/dhcp3-ntp.bak --local --rename --add /etc/dhcp3/dhclient-exit-hooks.d/ntp'
33+
elsif fact_on(host, 'osfamily') == 'RedHat'
34+
on host, 'echo "PEERNTP=no" >> /etc/sysconfig/network'
2435
end
2536
end
2637
end

0 commit comments

Comments
 (0)