Since13044d9f9ewas merged, we use the upstream ceph repo to pull packages for Ubuntu, and this broke the priority setting to avoid installing ceph packages from UCA repo. This change fixes that and ensure the priority is configured with the ceph repo. Backport note: This change includes972a226ab7which fixed the circular dependencies caused by the original change. Change-Id: I7b187d59f169689a7acd5cab013bb74d5cdfbf52 (cherry picked from commitcfdf592942) (cherry picked from commit7d9fd6332b)
167 lines
5.8 KiB
Puppet
167 lines
5.8 KiB
Puppet
class openstack_integration::repos {
|
|
|
|
# To make litmus tests work.
|
|
if defined('$::ceph_version') and $::ceph_version != '' {
|
|
$ceph_version_real = $::ceph_version
|
|
} else {
|
|
$ceph_version_real = 'nautilus'
|
|
}
|
|
case $::osfamily {
|
|
'Debian': {
|
|
case $::os_package_type {
|
|
'ubuntu': {
|
|
include apt
|
|
class { 'openstack_extras::repo::debian::ubuntu':
|
|
release => 'wallaby',
|
|
package_require => true,
|
|
uca_location => pick($::uca_mirror_host, 'http://ubuntu-cloud.archive.canonical.com/ubuntu'),
|
|
}
|
|
}
|
|
'debian': {
|
|
include apt
|
|
class { 'openstack_extras::repo::debian::debian':
|
|
release => 'ussuri',
|
|
package_require => true,
|
|
}
|
|
}
|
|
default: {
|
|
fail("Unsupported package type (${::os_package_type})")
|
|
}
|
|
}
|
|
|
|
$ceph_mirror_fallback = pick($::ceph_mirror_host, "http://download.ceph.com/debian-${ceph_version_real}/")
|
|
# Ceph is both packaged on UCA and official download.ceph.com packages
|
|
# which we mirror. We want to use the official packages or our mirror.
|
|
if $ceph_mirror_fallback !~ '^http://download.ceph.com/.*' {
|
|
$ceph_version_cap = capitalize($ceph_version_real)
|
|
apt::pin { 'ceph':
|
|
priority => 1001,
|
|
originator => "Ceph ${ceph_version_cap}",
|
|
}
|
|
} else {
|
|
apt::pin { 'ceph':
|
|
priority => 1001,
|
|
origin => 'download.ceph.com',
|
|
}
|
|
}
|
|
|
|
$enable_sig = false
|
|
$enable_epel = false
|
|
$ceph_mirror = $ceph_mirror_fallback
|
|
}
|
|
'RedHat': {
|
|
if defined('$::centos_mirror_host') and $::centos_mirror_host != '' {
|
|
$centos_mirror = $::centos_mirror_host
|
|
} else {
|
|
$centos_mirror = 'http://mirror.centos.org'
|
|
}
|
|
|
|
if defined('$::delorean_repo_path') and $::delorean_repo_path != '' {
|
|
$delorean_repo = $::delorean_repo_path
|
|
} else {
|
|
$delorean_repo = "https://trunk.rdoproject.org/centos${::os['release']['major']}-wallaby/puppet-passed-ci/delorean.repo"
|
|
}
|
|
|
|
if defined('$::delorean_deps_repo_path') and $::delorean_deps_repo_path != '' {
|
|
$delorean_deps_repo = $::delorean_deps_repo_path
|
|
} else {
|
|
$delorean_deps_repo = "https://trunk.rdoproject.org/centos${::os['release']['major']}-wallaby/delorean-deps.repo"
|
|
}
|
|
|
|
class { 'openstack_extras::repo::redhat::redhat':
|
|
manage_rdo => false,
|
|
manage_epel => false,
|
|
centos_mirror_url => $centos_mirror,
|
|
repo_source_hash => {
|
|
'delorean.repo' => $delorean_repo,
|
|
'delorean-deps.repo' => $delorean_deps_repo
|
|
},
|
|
repo_replace => false,
|
|
update_packages => true,
|
|
stream => true,
|
|
}
|
|
$ceph_mirror_fallback = "${centos_mirror}/centos/${::os['release']['major']}-stream/storage/x86_64/ceph-${ceph_version_real}/"
|
|
if defined('$::ceph_mirror_host') and $::ceph_mirror_host != '' {
|
|
$ceph_mirror = pick($::ceph_mirror_host, $ceph_mirror_fallback)
|
|
} else {
|
|
$ceph_mirror = $ceph_mirror_fallback
|
|
}
|
|
# On CentOS, deploy Ceph using SIG repository and get rid of EPEL.
|
|
# https://wiki.centos.org/SpecialInterestGroup/Storage/
|
|
if $::operatingsystem == 'CentOS' {
|
|
$enable_sig = true
|
|
$enable_epel = false
|
|
} else {
|
|
$enable_sig = false
|
|
$enable_epel = true
|
|
}
|
|
|
|
# PowerTools is required on CentOS8 since Ussuri.
|
|
if $::operatingsystem == 'CentOS' {
|
|
exec { 'enable-powertools':
|
|
command => 'dnf config-manager --enable powertools',
|
|
path => '/usr/bin/',
|
|
unless => 'test 0 -ne $(dnf repolist --enabled powertools | wc -l)'
|
|
}
|
|
}
|
|
|
|
# Remove Fedora Base repos as stable-base repo is configured which includes
|
|
# all required packages
|
|
if $::operatingsystem == 'Fedora' {
|
|
tidy { 'delete-fedora-base-repos':
|
|
path => '/etc/yum.repos.d',
|
|
recurse => true,
|
|
matches => [ 'fedora*.repo' ],
|
|
rmdirs => false,
|
|
require => Class['openstack_extras::repo::redhat::redhat'],
|
|
}
|
|
}
|
|
}
|
|
default: {
|
|
fail("Unsupported osfamily (${::osfamily})")
|
|
}
|
|
}
|
|
|
|
if $::osfamily == 'RedHat' or $::operatingsystem == 'Ubuntu' {
|
|
class { 'ceph::repo':
|
|
enable_sig => $enable_sig,
|
|
enable_epel => $enable_epel,
|
|
ceph_mirror => $ceph_mirror,
|
|
}
|
|
}
|
|
|
|
if $::osfamily == 'RedHat' {
|
|
# NOTE(tobias-urdin): Install libibverbs to fix an issue where OVS outputs errors
|
|
# that causes the puppet-openvswitch module to fail parsing the output.
|
|
# This issue does not occur in integration testing but only module tests since some
|
|
# other package (probably nova) causes this package to be installed, or the yum upgrade
|
|
# part in integration catches it.
|
|
# Reported upstream: https://bugzilla.redhat.com/show_bug.cgi?id=1658141
|
|
package { 'libibverbs':
|
|
ensure => 'present',
|
|
}
|
|
|
|
# NOTE(tobias-urdin): Needed where augeas is used, like puppet-ovn.
|
|
package { 'ruby-augeas':
|
|
ensure => 'present',
|
|
}
|
|
Yumrepo<||> -> Package<| title == 'ruby-augeas' |>
|
|
}
|
|
|
|
if $::operatingsystem == 'Ubuntu' {
|
|
# TODO(tobias-urdin): Something changed in packages that was installed in puppet-nova
|
|
# on Ubuntu so the rbd and rados python libs are not installed anymore.
|
|
# Need to figure out a good place to add them back in, until then just testing with this.
|
|
ensure_packages(['python3-rados', 'python3-rbd'], {
|
|
'ensure' => 'present',
|
|
'tag' => 'nova-python3-libs',
|
|
})
|
|
Apt::Source<||> -> Package<| tag == 'nova-python3-libs' |>
|
|
|
|
# NOTE(tobias-urdin): Needed where augeas is used, like puppet-ovn.
|
|
package { 'ruby-augeas':
|
|
ensure => 'present',
|
|
}
|
|
}
|
|
}
|