Use 'dnf' when configuring repo in Fedora

Use 'dnf' instead of 'yum' in Fedora as Fedora
no longer have 'yum' binary. Also Fedora do not
need yum-plugin-priorities to manage repo priorities.

Also Do not Enable rdo-qemu-ev repo for Fedora.

Change-Id: Id33c970e810ea48d74b9095b0e505d4e71be005a
This commit is contained in:
yatin 2018-06-25 19:52:09 +05:30
parent a13141f8e9
commit 7c4183e336
1 changed files with 13 additions and 6 deletions

View File

@ -115,7 +115,7 @@ class openstack_extras::repo::redhat::redhat(
create_resources('yumrepo', $rdo_hash, $_repo_defaults)
}
if $manage_virt {
if $manage_virt and ($::operatingsystem != 'Fedora') {
$virt_hash = {
'rdo-qemu-ev' => {
'baseurl' => "${centos_mirror_url}/centos/7/virt/\$basearch/kvm-common/",
@ -174,7 +174,7 @@ class openstack_extras::repo::redhat::redhat(
resources { 'yumrepo': purge => true }
}
if $manage_priorities {
if $manage_priorities and ($::operatingsystem != 'Fedora') {
exec { 'installing_yum-plugin-priorities':
command => '/usr/bin/yum install -y yum-plugin-priorities',
logoutput => 'on_failure',
@ -189,9 +189,16 @@ class openstack_extras::repo::redhat::redhat(
Yumrepo<||> -> Package<||>
}
exec { 'yum_refresh':
command => '/usr/bin/yum clean all',
refreshonly => true,
} -> Package <||>
if ($::operatingsystem == 'Fedora') {
exec { 'yum_refresh':
command => '/usr/bin/dnf clean all',
refreshonly => true,
} -> Package <||>
} else {
exec { 'yum_refresh':
command => '/usr/bin/yum clean all',
refreshonly => true,
} -> Package <||>
}
}