CentOS: Deprecate the stream parameter

... because now only CentOS Steam 9 is supported.

Change-Id: I9d39f23159505cec8fbcdd055e6c1fed4b995115
This commit is contained in:
Takashi Kajinami 2022-06-11 11:47:26 +09:00
parent 41f06f8f7b
commit a3b1787090
3 changed files with 27 additions and 53 deletions

View File

@ -70,10 +70,6 @@
# configured. # configured.
# Defaults to false # Defaults to false
# #
# [*stream*]
# (Optional) Is this CentOS Stream and should we adjust mirrors.
# Defaults to true
#
# DEPRECATED PARAMS # DEPRECATED PARAMS
# ================= # =================
# #
@ -82,6 +78,10 @@
# 'priority' value in yumrepo will be effective. # 'priority' value in yumrepo will be effective.
# Defaults to undef # Defaults to undef
# #
# [*stream*]
# (Optional) Is this CentOS Stream and should we adjust mirrors.
# Defaults to undef
#
class openstack_extras::repo::redhat::redhat ( class openstack_extras::repo::redhat::redhat (
$release = $openstack_extras::repo::redhat::params::release, $release = $openstack_extras::repo::redhat::params::release,
$manage_rdo = true, $manage_rdo = true,
@ -97,9 +97,9 @@ class openstack_extras::repo::redhat::redhat (
$package_require = false, $package_require = false,
$centos_mirror_url = $openstack_extras::repo::redhat::params::centos_mirror_url, $centos_mirror_url = $openstack_extras::repo::redhat::params::centos_mirror_url,
$update_packages = false, $update_packages = false,
$stream = true,
# DEPRECATED PARAMS # DEPRECATED PARAMS
$manage_priorities = undef, $manage_priorities = undef,
$stream = undef,
) inherits openstack_extras::repo::redhat::params { ) inherits openstack_extras::repo::redhat::params {
validate_legacy(String, 'validate_string', $release) validate_legacy(String, 'validate_string', $release)
@ -118,13 +118,14 @@ class openstack_extras::repo::redhat::redhat (
warning('openstack_extras::repo::redhat::redhat::manage_priorities parameter is deprecated and will be removed') warning('openstack_extras::repo::redhat::redhat::manage_priorities parameter is deprecated and will be removed')
} }
if $stream != undef {
warning('The stream parmeter has been deprecated and has no effect.')
}
$_repo_defaults = merge($openstack_extras::repo::redhat::params::repo_defaults, $repo_defaults) $_repo_defaults = merge($openstack_extras::repo::redhat::params::repo_defaults, $repo_defaults)
$_gpgkey_defaults = merge($openstack_extras::repo::redhat::params::gpgkey_defaults, $gpgkey_defaults) $_gpgkey_defaults = merge($openstack_extras::repo::redhat::params::gpgkey_defaults, $gpgkey_defaults)
$centos_major = $stream ? { $centos_major = "${facts['os']['release']['major']}-stream"
true => "${facts['os']['release']['major']}-stream",
default => $facts['os']['release']['major']
}
anchor { 'openstack_extras_redhat': } anchor { 'openstack_extras_redhat': }
@ -132,8 +133,8 @@ class openstack_extras::repo::redhat::redhat (
$release_cap = capitalize($release) $release_cap = capitalize($release)
$rdo_baseurl = $facts['os']['release']['major'] ? { $rdo_baseurl = $facts['os']['release']['major'] ? {
'9' => "${centos_mirror_url}/SIGs/${centos_major}/cloud/\$basearch/openstack-${release}/", '9' => "${centos_mirror_url}/SIGs/\$stream/cloud/\$basearch/openstack-${release}/",
default => "${centos_mirror_url}/centos/${centos_major}/cloud/\$basearch/openstack-${release}/" default => "${centos_mirror_url}/centos/\$stream/cloud/\$basearch/openstack-${release}/"
} }
$rdo_hash = { $rdo_hash = {
@ -169,9 +170,9 @@ class openstack_extras::repo::redhat::redhat (
} }
if $stream { if $stream {
$virt_baseurl = "${centos_mirror_url}/centos/${centos_major}/virt/\$basearch/advancedvirt-common/" $virt_baseurl = "${centos_mirror_url}/centos/\$stream/virt/\$basearch/advancedvirt-common/"
} else { } else {
$virt_baseurl = "${centos_mirror_url}/centos/${centos_major}/virt/\$basearch/advanced-virtualization/" $virt_baseurl = "${centos_mirror_url}/centos/\$stream/virt/\$basearch/advanced-virtualization/"
} }
# TODO(tobias-urdin): Remove this after one cycle. # TODO(tobias-urdin): Remove this after one cycle.

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``openstack_extras::repo::redhat::redhat::stream`` parameter has been
deprecate.

View File

@ -183,7 +183,7 @@ describe 'openstack_extras::repo::redhat::redhat' 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( it { should contain_yumrepo('rdo-release').with(
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/", :baseurl => "http://mirror.centos.org/centos/$stream/cloud/$basearch/openstack-yoga/",
:descr => "OpenStack Yoga Repository", :descr => "OpenStack Yoga 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',
:enabled => '1', :enabled => '1',
@ -203,7 +203,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
)} )}
it { should contain_yumrepo('centos-advanced-virt').with( it { should contain_yumrepo('centos-advanced-virt').with(
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/virt/$basearch/advancedvirt-common/", :baseurl => "http://mirror.centos.org/centos/$stream/virt/$basearch/advancedvirt-common/",
:descr => "CentOS-#{facts[:operatingsystemmajrelease]}-stream - Advanced Virt", :descr => "CentOS-#{facts[:operatingsystemmajrelease]}-stream - Advanced Virt",
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization', :gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization',
:enabled => '1', :enabled => '1',
@ -224,7 +224,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]}-stream/cloud/\$basearch/openstack-juno/", :baseurl => "http://mirror.centos.org/centos/$stream/cloud/$basearch/openstack-juno/",
:descr => 'OpenStack Juno Repository', :descr => 'OpenStack Juno Repository',
)} )}
end end
@ -240,25 +240,6 @@ describe 'openstack_extras::repo::redhat::redhat' do
} }
end end
context 'with stream is false' do
let :params do
{
:manage_rdo => true,
:manage_virt => true,
:stream => false,
}
end
it { should contain_yumrepo('rdo-release').with(
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}/cloud/\$basearch/openstack-yoga/",
)}
it { should contain_yumrepo('centos-advanced-virt').with(
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}/virt/\$basearch/advanced-virtualization/",
:descr => "CentOS-#{facts[:operatingsystemmajrelease]} - Advanced Virt",
)}
end
context 'with centos_mirror_url' do context 'with centos_mirror_url' do
let :params do let :params do
{ {
@ -269,11 +250,11 @@ 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/centos/$stream/cloud/$basearch/openstack-yoga/",
)} )}
it { should contain_yumrepo('centos-advanced-virt').with( it { should contain_yumrepo('centos-advanced-virt').with(
:baseurl => "http://foo.bar/centos/#{facts[:operatingsystemmajrelease]}-stream/virt/\$basearch/advancedvirt-common/", :baseurl => "http://foo.bar/centos/$stream/virt/$basearch/advancedvirt-common/",
)} )}
end end
@ -382,7 +363,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
it { should_not contain_yumrepo('centos-advanced-virt') } it { should_not contain_yumrepo('centos-advanced-virt') }
it { should contain_yumrepo('rdo-release').with( it { should contain_yumrepo('rdo-release').with(
:baseurl => "http://mirror.stream.centos.org/SIGs/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/", :baseurl => "http://mirror.stream.centos.org/SIGs/$stream/cloud/$basearch/openstack-yoga/",
:descr => "OpenStack Yoga Repository", :descr => "OpenStack Yoga 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',
:enabled => '1', :enabled => '1',
@ -403,24 +384,11 @@ 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.stream.centos.org/SIGs/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-juno/", :baseurl => "http://mirror.stream.centos.org/SIGs/$stream/cloud/$basearch/openstack-juno/",
:descr => 'OpenStack Juno Repository', :descr => 'OpenStack Juno Repository',
)} )}
end end
context 'with stream is false' do
let :params do
{
:manage_rdo => true,
:stream => false,
}
end
it { should contain_yumrepo('rdo-release').with(
:baseurl => "http://mirror.stream.centos.org/SIGs/#{facts[:operatingsystemmajrelease]}/cloud/\$basearch/openstack-yoga/",
)}
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' )
@ -440,7 +408,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/SIGs/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/", :baseurl => "http://foo.bar/SIGs/$stream/cloud/$basearch/openstack-yoga/",
)} )}
end end