From a3283bf79ff71d7ac1682e70f0307437f18aa54a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 6 Sep 2023 23:38:10 +0900 Subject: [PATCH] Remove support for CentOS 8 (non-stream) CentOS 8 reached its EOL a while ago. Because we already removed support for CentOS 7, we no longer support any non-stream CentOS versions. This deprecates the stream parameter and makes the stream repository used always. Change-Id: Iba3c8aea2f6dd8b9cca17ed1468a43d6c7d39b53 --- manifests/repo.pp | 27 ++++++------ .../deprecate-setram-89e53b60e8917f75.yaml | 8 ++++ spec/classes/ceph_repo_spec.rb | 41 ++++--------------- 3 files changed, 32 insertions(+), 44 deletions(-) create mode 100644 releasenotes/notes/deprecate-setram-89e53b60e8917f75.yaml diff --git a/manifests/repo.pp b/manifests/repo.pp index a196df36..244db54a 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -53,12 +53,14 @@ # https://wiki.centos.org/SpecialInterestGroup/Storage/ # Optional. Defaults to False in ceph::params. # -# [*stream*] Whether this is CentOS Stream or not. This parameter is used in CentOS only. -# Optional. Defaults to False. -# # [*ceph_mirror*] Ceph mirror used to download packages. # Optional. Defaults to undef. # +# DEPRECATED PARAMETERS +# +# [*stream*] Whether this is CentOS Stream or not. This parameter is used in CentOS only. +# Optional. Defaults to undef +# class ceph::repo ( $ensure = present, String[1] $release = $ceph::params::release, @@ -67,10 +69,15 @@ class ceph::repo ( $proxy_password = undef, Boolean $enable_epel = true, Boolean $enable_sig = $ceph::params::enable_sig, - Boolean $stream = false, $ceph_mirror = undef, + # DEPRECATED PARAMETERS + $stream = undef, ) inherits ceph::params { + if $stream != undef { + warning('The stream parameter has been deprecated and has no effect.') + } + case $facts['os']['family'] { 'Debian': { include apt @@ -112,16 +119,12 @@ not on ${facts['os']['name']}, which can lead to packaging issues.") $ceph_mirror_real = $ceph_mirror } else { # NOTE(tobias-urdin): mirror.centos.org doesnt have https support - if $stream { - if versioncmp($el, '9') >= 0 { - $centos_mirror = 'https://mirror.stream.centos.org/SIGs' - } else { - $centos_mirror = 'http://mirror.centos.org/centos' - } - $ceph_mirror_real = "${centos_mirror}/${el}-stream/storage/x86_64/ceph-${release}/" + if versioncmp($el, '9') >= 0 { + $centos_mirror = 'https://mirror.stream.centos.org/SIGs' } else { - $ceph_mirror_real = "http://mirror.centos.org/centos/${el}/storage/x86_64/ceph-${release}/" + $centos_mirror = 'http://mirror.centos.org/centos' } + $ceph_mirror_real = "${centos_mirror}/${el}-stream/storage/x86_64/ceph-${release}/" } yumrepo { 'ceph-storage-sig': ensure => $ensure, diff --git a/releasenotes/notes/deprecate-setram-89e53b60e8917f75.yaml b/releasenotes/notes/deprecate-setram-89e53b60e8917f75.yaml new file mode 100644 index 00000000..20a2d1db --- /dev/null +++ b/releasenotes/notes/deprecate-setram-89e53b60e8917f75.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - | + The ``ceph::repo::stream`` parameter has been deprecated and has no effect. + +upgrades: + - | + This module no longer supports CentOS 8. Use CentOS 8 Stream instead. diff --git a/spec/classes/ceph_repo_spec.rb b/spec/classes/ceph_repo_spec.rb index b4bc9612..317fa6fb 100644 --- a/spec/classes/ceph_repo_spec.rb +++ b/spec/classes/ceph_repo_spec.rb @@ -338,8 +338,9 @@ describe 'ceph::repo' do it { should_not contain_yumrepo('ext-ceph') } it { should_not contain_yumrepo('ext-ceph-noarch') } + it { should contain_yumrepo('ceph-storage-sig').with( - :baseurl => "http://mirror.centos.org/centos/#{facts[:os]['release']['major']}/storage/x86_64/ceph-nautilus/", + :baseurl => "#{platform_params[:centos_mirror]}/#{facts[:os]['release']['major']}-stream/storage/x86_64/ceph-nautilus/", )} end @@ -404,36 +405,6 @@ describe 'ceph::repo' do end end - shared_examples 'ceph::repo on CentOS Stream 8' do - context 'when using CentOS SIG repository and CentOS Stream 8' do - let :params do - { - :enable_sig => true, - :stream => true, - } - end - - it { should contain_yumrepo('ceph-storage-sig').with( - :baseurl => 'http://mirror.centos.org/centos/8-stream/storage/x86_64/ceph-nautilus/', - )} - end - end - - shared_examples 'ceph::repo on CentOS Stream 9' do - context 'when using CentOS SIG repository and CentOS Stream 9' do - let :params do - { - :enable_sig => true, - :stream => true, - } - end - - it { should contain_yumrepo('ceph-storage-sig').with( - :baseurl => 'https://mirror.stream.centos.org/SIGs/9-stream/storage/x86_64/ceph-nautilus/', - )} - end - end - on_supported_os({ :supported_os => OSDefaults.get_supported_os }).each do |os,facts| @@ -445,8 +416,14 @@ describe 'ceph::repo' do it_behaves_like "ceph::repo on #{facts[:os]['family']}" if facts[:os]['name'] == 'CentOS' + let (:platform_params) do + if facts[:os]['release']['major'].to_i >= 9 + { :centos_mirror => 'https://mirror.stream.centos.org/SIGs' } + else + { :centos_mirror => 'http://mirror.centos.org/centos' } + end + end it_behaves_like 'ceph::repo on CentOS' - it_behaves_like "ceph::repo on CentOS Stream #{facts[:os]['release']['major']}" end end end