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
This commit is contained in:
Takashi Kajinami 2022-06-13 22:53:14 +09:00
parent a3b1787090
commit b59c8bb986
2 changed files with 20 additions and 4 deletions

View File

@ -205,6 +205,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]}",
@ -359,8 +363,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/$stream/cloud/$basearch/openstack-yoga/",