Skip to content

Commit

Permalink
Merge pull request redhat-openstack#283 from DavidS/fix-ci-for-pe-next
Browse files Browse the repository at this point in the history
Fix CI for PE.next
  • Loading branch information
bmjen committed Jul 16, 2015
2 parents 8e763ef + 2a5b0ca commit ee1105b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
29 changes: 23 additions & 6 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,34 @@
}
}
'Suse': {
if $::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '12'
{
$service_name = 'ntpd'
$keys_file = '/etc/ntp.keys'
} else{
if $::operatingsystem == 'SLES' {
case $::operatingsystemmajrelease {
'10': {
$service_name = 'ntp'
$keys_file = '/etc/ntp.keys'
$package_name = [ 'xntp' ]
}
'11': {
$service_name = 'ntp'
$keys_file = $default_keys_file
$package_name = $default_package_name
}
'12': {
$service_name = 'ntpd'
$keys_file = '/etc/ntp.keys'
$package_name = $default_package_name
}
default: {
fail("The ${module_name} module is not supported on an ${::operatingsystem} ${::operatingsystemmajrelease} distribution.")
}
}
} else {
$service_name = 'ntp'
$keys_file = $default_keys_file
$package_name = $default_package_name
}
$config = $default_config
$driftfile = '/var/lib/ntp/drift/ntp.drift'
$package_name = $default_package_name
$restrict = [
'default kod nomodify notrap nopeer noquery',
'-6 default kod nomodify notrap nopeer noquery',
Expand Down
31 changes: 21 additions & 10 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,30 @@
run_puppet_install_helper

hosts.each do |host|
if host['platform'] =~ /sles-12/i || host['platform'] =~ /solaris-11/i
apply_manifest_on(host, 'package{"git":}')
on host, 'git clone -b 4.6.x https://github.com/puppetlabs/puppetlabs-stdlib /etc/puppetlabs/puppet/modules/stdlib'
# Solaris 11 doesn't ship the SSL CA root for the forgeapi server
# therefore we need to use a different way to deploy the module to
# the host
if host['platform'] =~ /solaris-11/i
apply_manifest_on(host, 'package { "git": }')
# PE 3.x and 2015.2 require different locations to install modules
modulepath = host.puppet['modulepath']
modulepath = modulepath.split(':').first if modulepath

environmentpath = host.puppet['environmentpath']
environmentpath = environmentpath.split(':').first if environmentpath

destdir = modulepath || "#{environmentpath}/production/modules"
on host, "git clone -b 4.6.0 https://github.com/puppetlabs/puppetlabs-stdlib #{destdir}/stdlib"
else
on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]}
on host, puppet('module install puppetlabs-stdlib')
end

#Need to disable update of ntp servers from DHCP, as subsequent restart of ntp causes test failures
if fact('osfamily') == 'Debian'
shell('[[ -f /etc/dhcp/dhclient-exit-hooks.d/ntp ]] && rm /etc/dhcp/dhcp-exit-hooks.d/ntp', { :acceptable_exit_codes => [0, 1] })
shell('[[ -f /etc/dhcp3/dhclient-exit-hooks.d/ntp ]] && rm /etc/dhcp3/dhcp-exit-hooks.d/ntp', { :acceptable_exit_codes => [0, 1] })
elsif fact('osfamily') == 'RedHat'
shell('echo "PEERNTP=no" >> /etc/sysconfig/network', { :acceptable_exit_codes => [0, 1]})
# Need to disable update of ntp servers from DHCP, as subsequent restart of ntp causes test failures
if fact_on(host, 'osfamily') == 'Debian'
on host, 'dpkg-divert --divert /etc/dhcp-ntp.bak --local --rename --add /etc/dhcp/dhclient-exit-hooks.d/ntp'
on host, 'dpkg-divert --divert /etc/dhcp3-ntp.bak --local --rename --add /etc/dhcp3/dhclient-exit-hooks.d/ntp'
elsif fact_on(host, 'osfamily') == 'RedHat'
on host, 'echo "PEERNTP=no" >> /etc/sysconfig/network'
end
end
end
Expand Down

0 comments on commit ee1105b

Please sign in to comment.