diff --git a/manifests/repo.pp b/manifests/repo.pp index ef717e7c..2c96da5d 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -56,6 +56,9 @@ # 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. # @@ -68,6 +71,7 @@ class ceph::repo ( $proxy_password = undef, $enable_epel = true, $enable_sig = $ceph::params::enable_sig, + $stream = false, $ceph_mirror = undef, ) inherits ceph::params { case $::osfamily { @@ -128,7 +132,11 @@ not on ${::operatingsystem}, which can lead to packaging issues.") $ceph_mirror_real = $ceph_mirror } else { # NOTE(tobias-urdin): mirror.centos.org doesnt have https support - $ceph_mirror_real = "http://mirror.centos.org/centos/${::operatingsystemmajrelease}/storage/x86_64/ceph-${release}/" + if $stream { + $ceph_mirror_real = "http://mirror.centos.org/centos/${::operatingsystemmajrelease}-stream/storage/x86_64/ceph-${release}/" + } else { + $ceph_mirror_real = "http://mirror.centos.org/centos/${::operatingsystemmajrelease}/storage/x86_64/ceph-${release}/" + } } yumrepo { 'ceph-luminous-sig': ensure => 'absent', diff --git a/releasenotes/notes/centos-stream-a43a0bbe65cf2aa8.yaml b/releasenotes/notes/centos-stream-a43a0bbe65cf2aa8.yaml new file mode 100644 index 00000000..fbc1675c --- /dev/null +++ b/releasenotes/notes/centos-stream-a43a0bbe65cf2aa8.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``ceph::repo::stream`` parameter has been added. Set this parameter + to ``true`` when CentOS Stream and SIG repository are used. diff --git a/spec/classes/ceph_repo_spec.rb b/spec/classes/ceph_repo_spec.rb index 5e21b323..0e5f269c 100644 --- a/spec/classes/ceph_repo_spec.rb +++ b/spec/classes/ceph_repo_spec.rb @@ -509,6 +509,24 @@ describe 'ceph::repo' do )} end + context 'when using CentOS SIG repository and CentOS Stream' do + let :params do + { + :enable_sig => true, + :stream => true, + } + end + + it { should_not contain_yumrepo('ext-epel-8') } + it { should_not contain_yumrepo('ext-ceph') } + it { should_not contain_yumrepo('ext-ceph-noarch') } + it { should contain_yumrepo('ceph-luminous-sig').with_ensure('absent') } + + it { should contain_yumrepo('ceph-storage-sig').with( + :baseurl => 'http://mirror.centos.org/centos/8-stream/storage/x86_64/ceph-nautilus/', + )} + end + context 'when using CentOS SIG repository from a mirror' do let :params do {