CentOS: Purge advanced-virt repository

This is follow-up of 7c456d4b69 and makes
sure the advanced-virt repository is purged when disabled.

Related-Bug: #1969484
Change-Id: I268675a4d17eb63861de5966e5b95434b792dd10
(cherry picked from commit b59c8bb986)
This commit is contained in:
Takashi Kajinami 2022-06-13 22:53:14 +09:00
parent 97566f0e09
commit efb900123c
2 changed files with 20 additions and 4 deletions

View File

@ -204,6 +204,14 @@ class openstack_extras::repo::redhat::redhat (
module_hotfixes => true,
}
}
} else {
# NOTE(tkajinam): Ensure the advanced-virt repository is purged
file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization':
ensure => absent
}
yumrepo { 'centos-advanced-virt':
ensure => absent
}
}
if $manage_epel {

View File

@ -43,8 +43,12 @@ describe 'openstack_extras::repo::redhat::redhat' do
it { should_not contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud') }
it { should_not contain_yumrepo('rdo-release') }
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 contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization').with(
:ensure => 'absent'
) }
it { should contain_yumrepo('centos-advanced-virt').with(
:ensure => 'absent'
) }
it { should contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}").with(
:source => "puppet:///modules/openstack_extras/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
@ -378,8 +382,12 @@ describe 'openstack_extras::repo::redhat::redhat' do
shared_examples 'openstack_extras::repo::redhat::redhat in CentOS >= 9' do
context 'with default parameters' do
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_yumrepo('centos-advanced-virt') }
it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization').with(
:ensure => 'absent'
) }
it { should contain_yumrepo('centos-advanced-virt').with(
:ensure => 'absent'
) }
it { should contain_yumrepo('rdo-release').with(
:baseurl => "http://mirror.stream.centos.org/SIGs/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-yoga/",