Update packages after adding repos

Make sure we upgrade packages after adding
repos so we have the latest packages when
testing in integration and beaker.
Change-Id: Ide4863f859931231636f21299be9d45f693d3b61
This commit is contained in:
Tobias Urdin
2018年08月22日 23:51:30 +02:00
parent a025a23601
commit 0a06eabd9b

View File

@@ -15,6 +15,7 @@ class openstack_integration::repos {
release => 'rocky',
package_require => true,
uca_location => pick($::uca_mirror_host, 'http://ubuntu-cloud.archive.canonical.com/ubuntu'),
before => File['/tmp/update-packages'],
}
}
'debian':{
@@ -22,6 +23,7 @@ class openstack_integration::repos {
class { '::openstack_extras::repo::debian::debian':
release => 'queens',
package_require => true,
before => File['/tmp/update-packages'],
}
}
default:{
@@ -35,11 +37,13 @@ class openstack_integration::repos {
apt::pin { 'ceph':
priority => 1001,
originator => "Ceph ${ceph_version_cap}",
before=>File['/tmp/update-packages'],
}
}else{
apt::pin { 'ceph':
priority => 1001,
origin => 'download.ceph.com',
before => File['/tmp/update-packages'],
}
}
$enable_sig=false
@@ -64,6 +68,7 @@ class openstack_integration::repos {
'gpgcheck' => 'no',
},
},
before=>File['/tmp/update-packages'],
}
#TODO(tobasco):RemovethisCBScandidaterepoforMimicwhenStorageSIGreleaseit.
$ceph_mirror_fallback=$ceph_version_real?{
@@ -89,6 +94,7 @@ class openstack_integration::repos {
matches => [ 'fedora*.repo' ],
rmdirs => false,
require => Class['::openstack_extras::repo::redhat::redhat'],
before => File['/tmp/update-packages'],
}
}
}
@@ -101,6 +107,30 @@ class openstack_integration::repos {
enable_sig => $enable_sig,
enable_epel => $enable_epel,
ceph_mirror => $ceph_mirror,
before => File['/tmp/update-packages'],
}
#Wewanttoupgradepackagesafterreposisaddedbutonlyonce
#tonotbreakidempotency.Mustbedoneinheresoitappliesto
#bothintegrationandbeakertests.
if$::osfamily=='RedHat'{
if $::operatingsystem == 'Fedora' {
$yum_cmd = '/usr/bin/dnf'
}else{
$yum_cmd = '/usr/bin/yum'
}
$update_cmd="${yum_cmd} update -y"
}else{
$update_cmd = '/usr/bin/apt upgrade -y'
}
file{ '/tmp/update-packages':
ensure => 'present',
notify => Exec['update-packages'],
}
exec{ 'update-packages':
command => $update_cmd,
refreshonly => true,
}
}

View File

@@ -204,14 +204,6 @@ if [ "${MANAGE_REPOS}" = true ]; then
print_header 'Puppet failed to install repositories.'
exit 1
fi
if is_fedora; then
print_header 'Updating packages'
$SUDO $YUM update -y
if [ $? -ne 0 ]; then
print_header 'Error updating packages'
exit 1
fi
fi
fi
print_header "Running Puppet Scenario: ${SCENARIO} (1st time)"
Reference in New Issue
openstack/puppet-openstack-integration
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.