repo/redhat: install yum-plugin-priorities prior to Yumrepo
yum-plugin-priorities needs to be installed before installing any package, otherwise if we install it after having repos in place, it becomes useless. This patch makes sure we install yum-plugin-priorities before any Yumrepo resource, so we make sure that Yum priorities will be addressed correctly. Change-Id: If99af9b7fd90b1408747a4be874aebeb05dfb2d6
This commit is contained in:
parent
de886f6e65
commit
481fe00110
@ -87,12 +87,6 @@ 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)
|
||||
|
||||
@ -155,6 +149,17 @@ class openstack_extras::repo::redhat::redhat(
|
||||
resources { 'yumrepo': purge => true }
|
||||
}
|
||||
|
||||
if $manage_priorities {
|
||||
exec { 'installing_yum-plugin-priorities':
|
||||
command => '/usr/bin/yum install -y yum-plugin-priorities',
|
||||
logoutput => 'on_failure',
|
||||
tries => 3,
|
||||
try_sleep => 1,
|
||||
unless => '/usr/bin/rpm -qa | /usr/bin/grep -q yum-plugin-priorities',
|
||||
}
|
||||
Exec['installing_yum-plugin-priorities'] -> Yumrepo<||>
|
||||
}
|
||||
|
||||
if $package_require {
|
||||
Yumrepo<||> -> Package<||>
|
||||
}
|
||||
|
@ -61,9 +61,13 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
||||
:notify => "Exec[yum_refresh]"
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_package('yum-plugin-priorities').with(
|
||||
:ensure => 'present',
|
||||
)}
|
||||
it { is_expected.to contain_exec('installing_yum-plugin-priorities').with(
|
||||
:command => '/usr/bin/yum install -y yum-plugin-priorities',
|
||||
:logoutput => 'on_failure',
|
||||
:tries => 3,
|
||||
:try_sleep => 1,
|
||||
:unless => '/usr/bin/rpm -qa | /usr/bin/grep -q yum-plugin-priorities',
|
||||
) }
|
||||
|
||||
# 'metalink' property is supported from Puppet 3.5
|
||||
if Puppet.version.to_f >= 3.5
|
||||
@ -209,7 +213,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
||||
default_params.merge!({ :manage_priorities => false })
|
||||
end
|
||||
|
||||
it { is_expected.to_not contain_package('yum-plugin-priorities') }
|
||||
it { is_expected.to_not contain_exec('installing_yum-plugin-priorities') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user