Fix ceph repos for stream

In CentOS 9 stream the ceph repos are part of a SIGs namespace.
Additionally CentOS 8 is now stream only so we should use the 8-stream
version of the storage repos.

Change-Id: I015145ce615bffbd1ef0c76814688de4514b29a9
This commit is contained in:
Alex Schultz 2022-01-19 14:34:30 -07:00
parent 66eb29abf8
commit 4a6c30f891
2 changed files with 31 additions and 5 deletions

View File

@ -53,6 +53,13 @@ baseurl=%(mirror)s/centos/%(centos_release)s/storage/$basearch/ceph-%(ceph_relea
gpgcheck=0
enabled=1
'''
CEPH_SIG_REPO_TEMPLATE = '''
[tripleo-centos-ceph-%(ceph_release)s]
name=tripleo-centos-ceph-%(ceph_release)s
baseurl=%(mirror)s/SIGs/%(centos_release)s/storage/$basearch/ceph-%(ceph_release)s/
gpgcheck=0
enabled=1
'''
OPSTOOLS_REPO_TEMPLATE = '''
[tripleo-centos-opstools]
name=tripleo-centos-opstools
@ -392,10 +399,18 @@ def _install_priorities():
def _create_ceph(args, release):
"""Generate a Ceph repo file for release"""
centos_release = '7' if args.distro == 'centos7' else '8'
return CEPH_REPO_TEMPLATE % {'centos_release': centos_release,
'ceph_release': release,
'mirror': args.mirror}
centos_release = '9-stream'
template = CEPH_SIG_REPO_TEMPLATE
if args.distro == 'centos7':
centos_release = '7'
template = CEPH_REPO_TEMPLATE
elif args.distro == 'centos8':
centos_release = '8-stream'
template = CEPH_REPO_TEMPLATE
return template % {'centos_release': centos_release,
'ceph_release': release,
'mirror': args.mirror}
def _change_priority(content, new_priority):

View File

@ -590,7 +590,18 @@ enabled=1
expected_repo = '''
[tripleo-centos-ceph-jewel]
name=tripleo-centos-ceph-jewel
baseurl=http://foo/centos/8/storage/$basearch/ceph-jewel/
baseurl=http://foo/SIGs/9-stream/storage/$basearch/ceph-jewel/
gpgcheck=0
enabled=1
'''
self.assertEqual(expected_repo, result)
mock_args = mock.Mock(mirror='http://foo', distro='centos8')
result = main._create_ceph(mock_args, 'jewel')
expected_repo = '''
[tripleo-centos-ceph-jewel]
name=tripleo-centos-ceph-jewel
baseurl=http://foo/centos/8-stream/storage/$basearch/ceph-jewel/
gpgcheck=0
enabled=1
'''