From f624ec4cb8771736ffbe3fe81b2949edda159863 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 15 Apr 2015 16:11:08 -0400 Subject: [PATCH] Prefer dnf to yum. On Fedora 22 and later, yum is deprecated and dnf is installed by default. However, the detection do not seems to take this in account, and always use yum, even when yum cli is just a wrapper to tell "use dnf", as this is the case on F22 and later ( see package dnf-yum ). As dnf is not installed by default, except on F22, this shouldn't break anything. --- lib/ansible/module_utils/facts.py | 1 + v2/ansible/module_utils/facts.py | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 595629a7109..6b817d4ebcc 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -106,6 +106,7 @@ class Facts(object): # package manager, put the preferred one last. If there is an # ansible module, use that as the value for the 'name' key. PKG_MGRS = [ { 'path' : '/usr/bin/yum', 'name' : 'yum' }, + { 'path' : '/usr/bin/dnf', 'name' : 'dnf' }, { 'path' : '/usr/bin/apt-get', 'name' : 'apt' }, { 'path' : '/usr/bin/zypper', 'name' : 'zypper' }, { 'path' : '/usr/sbin/urpmi', 'name' : 'urpmi' }, diff --git a/v2/ansible/module_utils/facts.py b/v2/ansible/module_utils/facts.py index d18615857cc..ae1a3094b60 100644 --- a/v2/ansible/module_utils/facts.py +++ b/v2/ansible/module_utils/facts.py @@ -105,6 +105,7 @@ class Facts(object): # package manager, put the preferred one last. If there is an # ansible module, use that as the value for the 'name' key. PKG_MGRS = [ { 'path' : '/usr/bin/yum', 'name' : 'yum' }, + { 'path' : '/usr/bin/dnf', 'name' : 'dnf' }, { 'path' : '/usr/bin/apt-get', 'name' : 'apt' }, { 'path' : '/usr/bin/zypper', 'name' : 'zypper' }, { 'path' : '/usr/sbin/urpmi', 'name' : 'urpmi' },