repos/redhat: install yum-plugin-priorities
yum-plugin-priorities package is needed when running RDO trunk packaging, repositories have priorities and we need to address them. This patch adds a boolean: $manage_priorities, set to True by default. If set to False, yum-plugin-priorities package won't be installed by this module. Change-Id: I3ac207f744847b5742fc331d2c16d1dad475f9ea
This commit is contained in:
parent
fb85b43b29
commit
bbaf0667ae
@ -49,16 +49,22 @@
|
||||
# yumrepos be set.
|
||||
# Defaults to false
|
||||
#
|
||||
# [*manage_priorities*]
|
||||
# (optional) Whether to install yum-plugin-priorities package so
|
||||
# 'priority' value in yumrepo will be effective.
|
||||
# Defaults to true
|
||||
#
|
||||
class openstack_extras::repo::redhat::redhat(
|
||||
$release = $::openstack_extras::repo::redhat::params::release,
|
||||
$manage_rdo = true,
|
||||
$manage_epel = true,
|
||||
$repo_hash = {},
|
||||
$repo_defaults = {},
|
||||
$gpgkey_hash = {},
|
||||
$gpgkey_defaults = {},
|
||||
$purge_unmanaged = false,
|
||||
$package_require = false
|
||||
$release = $::openstack_extras::repo::redhat::params::release,
|
||||
$manage_rdo = true,
|
||||
$manage_epel = true,
|
||||
$repo_hash = {},
|
||||
$repo_defaults = {},
|
||||
$gpgkey_hash = {},
|
||||
$gpgkey_defaults = {},
|
||||
$purge_unmanaged = false,
|
||||
$package_require = false,
|
||||
$manage_priorities = true,
|
||||
) inherits openstack_extras::repo::redhat::params {
|
||||
|
||||
validate_string($release)
|
||||
@ -76,6 +82,12 @@ class openstack_extras::repo::redhat::redhat(
|
||||
|
||||
anchor { 'openstack_extras_redhat': }
|
||||
|
||||
if $manage_priorities {
|
||||
package { 'yum-plugin-priorities':
|
||||
ensure => 'present',
|
||||
}
|
||||
}
|
||||
|
||||
if $manage_rdo {
|
||||
$release_cap = capitalize($release)
|
||||
|
||||
|
@ -61,6 +61,10 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
||||
:notify => "Exec[yum_refresh]"
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_package('yum-plugin-priorities').with(
|
||||
:ensure => 'present',
|
||||
)}
|
||||
|
||||
# 'metalink' property is supported from Puppet 3.5
|
||||
if Puppet.version.to_f >= 3.5
|
||||
it { is_expected.to contain_yumrepo('epel').with(
|
||||
@ -199,5 +203,12 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
||||
|
||||
it { is_expected.to_not contain_yumrepo('rdo-release') }
|
||||
end
|
||||
describe 'with manage_priorities disabled' do
|
||||
let :params do
|
||||
default_params.merge!({ :manage_priorities => false })
|
||||
end
|
||||
|
||||
it { is_expected.to_not contain_package('yum-plugin-priorities') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user