RDO: ensure rdo-release is not installed
Because rdo-release might already been provided by distros, we need to make sure the package is not installed, otherwise this module will install a repo maybe older than the one installed by rdo-release. Example: if you try to install the kilo repo, the rdo-release will install liberty (because it's the latest), so we need to make sure we drop the package and let Puppet manage the repo. Change-Id: I80dcaf4cacbf12176ceeba36ddb740e93086c5d7
This commit is contained in:
parent
2d08ba975b
commit
2b0b0ab0e8
|
@ -77,6 +77,7 @@ class openstack_extras::repo::redhat::redhat(
|
|||
anchor { 'openstack_extras_redhat': }
|
||||
|
||||
if $manage_rdo {
|
||||
|
||||
$release_cap = capitalize($release)
|
||||
# In kilo the URL pattern changed
|
||||
if $release < 'kilo' { # Lexicographically before 'k' release
|
||||
|
@ -98,6 +99,16 @@ class openstack_extras::repo::redhat::redhat(
|
|||
}
|
||||
}
|
||||
|
||||
# make sure rdo-release package is not installed
|
||||
# since it overlaps with that we're doing in this manifest
|
||||
exec { 'drop rdo-release package':
|
||||
command => '/usr/bin/yum -y remove rdo-release',
|
||||
onlyif => '/usr/bin/rpm -qa | /usr/bin/grep -q rdo-release',
|
||||
logoutput => 'on_failure',
|
||||
tries => 3,
|
||||
try_sleep => 1,
|
||||
}
|
||||
|
||||
create_resources('file', $rdokey_hash, $_gpgkey_defaults)
|
||||
create_resources('yumrepo', $rdo_hash, $_repo_defaults)
|
||||
}
|
||||
|
|
|
@ -49,6 +49,14 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||
{}.merge!(default_params)
|
||||
end
|
||||
|
||||
it { should contain_exec('drop rdo-release package').with(
|
||||
:command => '/usr/bin/yum -y remove rdo-release',
|
||||
:onlyif => '/usr/bin/rpm -qa | /usr/bin/grep -q rdo-release',
|
||||
:logoutput => 'on_failure',
|
||||
:tries => 3,
|
||||
:try_sleep => 1,
|
||||
)}
|
||||
|
||||
it { should contain_yumrepo('rdo-release').with(
|
||||
:baseurl => "http://repos.fedorapeople.org/repos/openstack/openstack-kilo/el7/",
|
||||
:descr => "OpenStack Kilo Repository",
|
||||
|
|
Loading…
Reference in New Issue