Set module_hotfixes=true for yumrepo if Puppet >= 6.15.0
The RDO and CentOS Advanced Virt repositories contains
packages that should be considered hotfixes to version
found in Base repo and similar and should have priority
over them.
The yumrepo_core [1] change that was released in 1.0.7
adds the module_hotfixes parameter to yumrepo and it's
included in Puppet >= 6.15.0 which we should set to true
to make sure packages in RDO and CentOS Advanced Virt
repos is considered hotfixes upon base packages.
When we only support Puppet 7 and forward we should set
this by default for the yumrepo resources.
[1] a14c059b7d
Depends-On: https://review.opendev.org/c/792966
Change-Id: Ie747273e2ce23fadba0f3946e227ee143c1632db
This commit is contained in:
parent
bf93facef3
commit
ad70eae45b
manifests/repo/redhat
releasenotes/notes
spec/classes
@ -147,6 +147,15 @@ class openstack_extras::repo::redhat::redhat (
|
|||||||
|
|
||||||
create_resources('file', $rdokey_hash, $_gpgkey_defaults)
|
create_resources('file', $rdokey_hash, $_gpgkey_defaults)
|
||||||
create_resources('yumrepo', $rdo_hash, $_repo_defaults)
|
create_resources('yumrepo', $rdo_hash, $_repo_defaults)
|
||||||
|
|
||||||
|
# NOTE(tobias-urdin): This was introduced in yumrepo_core 1.0.7 which is
|
||||||
|
# included from 6.15.0 and forward (also since 7.0.0).
|
||||||
|
# TODO(tobias-urdin): Should set this by default when we only support Puppet 7.
|
||||||
|
if versioncmp($::puppetversion, '6.15.0') >= 0 {
|
||||||
|
Yumrepo<| title == 'rdo-release' |> {
|
||||||
|
module_hotfixes => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $manage_virt and ($facts['os']['name'] != 'Fedora') {
|
if $manage_virt and ($facts['os']['name'] != 'Fedora') {
|
||||||
@ -177,6 +186,15 @@ class openstack_extras::repo::redhat::redhat (
|
|||||||
|
|
||||||
create_resources('file', $virtkey_hash, $_gpgkey_defaults)
|
create_resources('file', $virtkey_hash, $_gpgkey_defaults)
|
||||||
create_resources('yumrepo', $virt_hash, $_repo_defaults)
|
create_resources('yumrepo', $virt_hash, $_repo_defaults)
|
||||||
|
|
||||||
|
# NOTE(tobias-urdin): This was introduced in yumrepo_core 1.0.7 which is
|
||||||
|
# included from 6.15.0 and forward (also since 7.0.0).
|
||||||
|
# TODO(tobias-urdin): Should set this by default when we only support Puppet 7.
|
||||||
|
if versioncmp($::puppetversion, '6.15.0') >= 0 {
|
||||||
|
Yumrepo<| title == 'centos-advanced-virt' |> {
|
||||||
|
module_hotfixes => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($manage_epel and $facts['os']['name'] != 'Fedora') {
|
if ($manage_epel and $facts['os']['name'] != 'Fedora') {
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The yumrepo resources for RDO and CentOS Advanced Virt in the
|
||||||
|
openstack_extras::repo::redhat::redhat class now sets the new
|
||||||
|
parameter module_hotfixes included since 6.15.0 if the Puppet
|
||||||
|
version is supporting that. If you for some reason is using
|
||||||
|
standalone Puppet that does not include vendored modules (i.e
|
||||||
|
you are not using Puppet packages) you will need to make sure
|
||||||
|
that yumrepo_core >= 1.0.7 is used.
|
@ -14,14 +14,15 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
it { should contain_yumrepo('rdo-release').with(
|
it { should contain_yumrepo('rdo-release').with(
|
||||||
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-victoria/",
|
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/cloud/$basearch/openstack-victoria/",
|
||||||
:descr => "OpenStack Victoria Repository",
|
:descr => "OpenStack Victoria Repository",
|
||||||
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud',
|
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud',
|
||||||
:enabled => '1',
|
:enabled => '1',
|
||||||
:gpgcheck => '1',
|
:gpgcheck => '1',
|
||||||
:mirrorlist => 'absent',
|
:mirrorlist => 'absent',
|
||||||
:notify => 'Exec[yum_refresh]',
|
:module_hotfixes => true,
|
||||||
:require => 'Anchor[openstack_extras_redhat]',
|
:notify => 'Exec[yum_refresh]',
|
||||||
|
:require => 'Anchor[openstack_extras_redhat]',
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { should contain_yumrepo('rdo-qemu-ev').with_ensure('absent') }
|
it { should contain_yumrepo('rdo-qemu-ev').with_ensure('absent') }
|
||||||
@ -35,14 +36,15 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
it { should contain_yumrepo('centos-advanced-virt').with(
|
it { should contain_yumrepo('centos-advanced-virt').with(
|
||||||
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/virt/$basearch/advancedvirt-common/",
|
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}-stream/virt/$basearch/advancedvirt-common/",
|
||||||
:descr => "CentOS-#{facts[:operatingsystemmajrelease]}-stream - Advanced Virt",
|
:descr => "CentOS-#{facts[:operatingsystemmajrelease]}-stream - Advanced Virt",
|
||||||
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization',
|
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization',
|
||||||
:enabled => '1',
|
:enabled => '1',
|
||||||
:gpgcheck => '1',
|
:gpgcheck => '1',
|
||||||
:mirrorlist => 'absent',
|
:mirrorlist => 'absent',
|
||||||
:notify => 'Exec[yum_refresh]',
|
:module_hotfixes => true,
|
||||||
:require => 'Anchor[openstack_extras_redhat]',
|
:notify => 'Exec[yum_refresh]',
|
||||||
|
:require => 'Anchor[openstack_extras_redhat]',
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { should_not contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}") }
|
it { should_not contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}") }
|
||||||
@ -58,6 +60,17 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
it { should_not contain_exec('yum_update') }
|
it { should_not contain_exec('yum_update') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with default parameters but puppetversion < 6.15.0' do
|
||||||
|
before do
|
||||||
|
facts.merge!( :puppetversion => '6.14.0' )
|
||||||
|
end
|
||||||
|
|
||||||
|
it {
|
||||||
|
should contain_yumrepo('rdo-release').without_module_hotfixes
|
||||||
|
should contain_yumrepo('centos-advanced-virt').without_module_hotfixes
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
context 'with parameters' do
|
context 'with parameters' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user