cs9: Fix URL for OpenStack packages
CentOS Stream 9 packages are hosted at mirror.stream.centos.org instead of mirror.centos.org. Also the directory structure is a bit different in the new mirror server. Closes-Bug: #1978332 Change-Id: Ie8436a527fc308b70a7c3b34fb86a32604f836ff
This commit is contained in:
parent
351cd24276
commit
41f06f8f7b
manifests/repo/redhat
releasenotes/notes
spec/classes
@ -7,9 +7,11 @@ class openstack_extras::repo::redhat::params {
|
|||||||
$release = 'yoga'
|
$release = 'yoga'
|
||||||
|
|
||||||
if versioncmp($::operatingsystemmajrelease, '9') >= 0 {
|
if versioncmp($::operatingsystemmajrelease, '9') >= 0 {
|
||||||
$manage_virt = false
|
$centos_mirror_url = 'http://mirror.stream.centos.org'
|
||||||
|
$manage_virt = false
|
||||||
} else {
|
} else {
|
||||||
$manage_virt = true
|
$centos_mirror_url = 'http://mirror.centos.org'
|
||||||
|
$manage_virt = true
|
||||||
}
|
}
|
||||||
|
|
||||||
$repo_defaults = {
|
$repo_defaults = {
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
#
|
#
|
||||||
# [*centos_mirror_url*]
|
# [*centos_mirror_url*]
|
||||||
# (Optional) URL of CentOS mirror.
|
# (Optional) URL of CentOS mirror.
|
||||||
# Defaults to 'http://mirror.centos.org'
|
# Defaults to $openstack_extras::repo::redhat::params::centos_mirror_url
|
||||||
#
|
#
|
||||||
# [*update_packages*]
|
# [*update_packages*]
|
||||||
# (Optional) Whether to update all packages after yum repositories are
|
# (Optional) Whether to update all packages after yum repositories are
|
||||||
@ -95,7 +95,7 @@ class openstack_extras::repo::redhat::redhat (
|
|||||||
$gpgkey_defaults = {},
|
$gpgkey_defaults = {},
|
||||||
$purge_unmanaged = false,
|
$purge_unmanaged = false,
|
||||||
$package_require = false,
|
$package_require = false,
|
||||||
$centos_mirror_url = 'http://mirror.centos.org',
|
$centos_mirror_url = $openstack_extras::repo::redhat::params::centos_mirror_url,
|
||||||
$update_packages = false,
|
$update_packages = false,
|
||||||
$stream = true,
|
$stream = true,
|
||||||
# DEPRECATED PARAMS
|
# DEPRECATED PARAMS
|
||||||
@ -131,9 +131,14 @@ class openstack_extras::repo::redhat::redhat (
|
|||||||
if $manage_rdo {
|
if $manage_rdo {
|
||||||
$release_cap = capitalize($release)
|
$release_cap = capitalize($release)
|
||||||
|
|
||||||
|
$rdo_baseurl = $facts['os']['release']['major'] ? {
|
||||||
|
'9' => "${centos_mirror_url}/SIGs/${centos_major}/cloud/\$basearch/openstack-${release}/",
|
||||||
|
default => "${centos_mirror_url}/centos/${centos_major}/cloud/\$basearch/openstack-${release}/"
|
||||||
|
}
|
||||||
|
|
||||||
$rdo_hash = {
|
$rdo_hash = {
|
||||||
'rdo-release' => {
|
'rdo-release' => {
|
||||||
'baseurl' => "${centos_mirror_url}/centos/${centos_major}/cloud/\$basearch/openstack-${release}/",
|
'baseurl' => $rdo_baseurl,
|
||||||
'descr' => "OpenStack ${release_cap} Repository",
|
'descr' => "OpenStack ${release_cap} Repository",
|
||||||
'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud',
|
'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud',
|
||||||
}
|
}
|
||||||
|
5
releasenotes/notes/bug-1978332-8b223e30a7f30165.yaml
Normal file
5
releasenotes/notes/bug-1978332-8b223e30a7f30165.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
The ``openstack_extras::repos::redhat::redhat`` class now configures RDO
|
||||||
|
repository properly in CentOS Stream 9.
|
@ -13,18 +13,6 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
:before => 'Anchor[openstack_extras_redhat]',
|
:before => 'Anchor[openstack_extras_redhat]',
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { should contain_yumrepo('rdo-release').with(
|
|
||||||
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/",
|
|
||||||
:descr => "OpenStack Yoga Repository",
|
|
||||||
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud',
|
|
||||||
:enabled => '1',
|
|
||||||
:gpgcheck => '1',
|
|
||||||
:mirrorlist => 'absent',
|
|
||||||
:module_hotfixes => true,
|
|
||||||
:notify => 'Exec[yum_refresh]',
|
|
||||||
:require => 'Anchor[openstack_extras_redhat]',
|
|
||||||
)}
|
|
||||||
|
|
||||||
it { should_not contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}") }
|
it { should_not contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}") }
|
||||||
it { should_not contain_yumrepo('epel') }
|
it { should_not contain_yumrepo('epel') }
|
||||||
|
|
||||||
@ -92,20 +80,6 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with overridden release' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:release => 'juno',
|
|
||||||
:manage_rdo => true,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_yumrepo('rdo-release').with(
|
|
||||||
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/\$basearch/openstack-juno/",
|
|
||||||
:descr => 'OpenStack Juno Repository',
|
|
||||||
)}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with overridden repo_hash and gpgkey_hash' do
|
context 'with overridden repo_hash and gpgkey_hash' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
@ -208,6 +182,18 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
context 'with default parameters' do
|
context 'with default parameters' do
|
||||||
it { should contain_yumrepo('rdo-qemu-ev').with_ensure('absent') }
|
it { should contain_yumrepo('rdo-qemu-ev').with_ensure('absent') }
|
||||||
|
|
||||||
|
it { should contain_yumrepo('rdo-release').with(
|
||||||
|
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/",
|
||||||
|
:descr => "OpenStack Yoga Repository",
|
||||||
|
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud',
|
||||||
|
:enabled => '1',
|
||||||
|
:gpgcheck => '1',
|
||||||
|
:mirrorlist => 'absent',
|
||||||
|
:module_hotfixes => true,
|
||||||
|
:notify => 'Exec[yum_refresh]',
|
||||||
|
:require => 'Anchor[openstack_extras_redhat]',
|
||||||
|
)}
|
||||||
|
|
||||||
it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization').with(
|
it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization').with(
|
||||||
:source => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-CentOS-SIG-Virtualization',
|
:source => 'puppet:///modules/openstack_extras/RPM-GPG-KEY-CentOS-SIG-Virtualization',
|
||||||
:owner => 'root',
|
:owner => 'root',
|
||||||
@ -229,6 +215,20 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with overridden release' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:release => 'juno',
|
||||||
|
:manage_rdo => true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_yumrepo('rdo-release').with(
|
||||||
|
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/\$basearch/openstack-juno/",
|
||||||
|
:descr => 'OpenStack Juno Repository',
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
context 'with default parameters but puppetversion < 6.15.0' do
|
context 'with default parameters but puppetversion < 6.15.0' do
|
||||||
before do
|
before do
|
||||||
facts.merge!( :puppetversion => '6.14.0' )
|
facts.merge!( :puppetversion => '6.14.0' )
|
||||||
@ -380,6 +380,32 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
it { should_not contain_yumrepo('rdo-qemu-ev') }
|
it { should_not contain_yumrepo('rdo-qemu-ev') }
|
||||||
it { should_not contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization') }
|
it { should_not contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization') }
|
||||||
it { should_not contain_yumrepo('centos-advanced-virt') }
|
it { should_not contain_yumrepo('centos-advanced-virt') }
|
||||||
|
|
||||||
|
it { should contain_yumrepo('rdo-release').with(
|
||||||
|
:baseurl => "http://mirror.stream.centos.org/SIGs/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/",
|
||||||
|
:descr => "OpenStack Yoga Repository",
|
||||||
|
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud',
|
||||||
|
:enabled => '1',
|
||||||
|
:gpgcheck => '1',
|
||||||
|
:mirrorlist => 'absent',
|
||||||
|
:module_hotfixes => true,
|
||||||
|
:notify => 'Exec[yum_refresh]',
|
||||||
|
:require => 'Anchor[openstack_extras_redhat]',
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with overridden release' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:release => 'juno',
|
||||||
|
:manage_rdo => true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { should contain_yumrepo('rdo-release').with(
|
||||||
|
:baseurl => "http://mirror.stream.centos.org/SIGs/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-juno/",
|
||||||
|
:descr => 'OpenStack Juno Repository',
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with stream is false' do
|
context 'with stream is false' do
|
||||||
@ -391,7 +417,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_yumrepo('rdo-release').with(
|
it { should contain_yumrepo('rdo-release').with(
|
||||||
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}/cloud/\$basearch/openstack-yoga/",
|
:baseurl => "http://mirror.stream.centos.org/SIGs/#{facts[:operatingsystemmajrelease]}/cloud/\$basearch/openstack-yoga/",
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -414,7 +440,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_yumrepo('rdo-release').with(
|
it { should contain_yumrepo('rdo-release').with(
|
||||||
:baseurl => "http://foo.bar/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/\$basearch/openstack-yoga/",
|
:baseurl => "http://foo.bar/SIGs/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/",
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user