[Ansible][Fedora 24] DNF Module Requires python2-dnf but it is Already Installed
<p>I have computers on an internal network that is not connected to the internet, and have copied the relevant rpm packages into my local dnf repository. I'm trying to get ansible's DNF module to install a program on another computer but it pops up an error message stating that python2-dnf is not installed. But when I try to install the program it is already installed. Anyone have an idea whats going wrong?</p>

<p>I've placed the error code below.</p>

<hr>

<p>Background: </p>

<pre><code>Ansible Control machine: Fedora 24 4.5.5-300.fc24.x86_64 GNU/LINUX
Ansible Client machine: Fedora 24 4.5.5-300.fc24.x86_64 GNU/LINUX 
yum/dnf local repository: Centos 7 3.10.0-327.28.3.el7.x86_64 GNU/LINUX
</code></pre>

<hr>

<p>[root@localhost ansible]# ansible all -m dnf -a "name=vim state=present" </p>

<pre><code>192.168.10.10 | FAILED! =&gt; { 
"changed": false, 
"failed": true
, "msg": "python2-dnf is not installed, but it is required for the Ansible dnf module." 
} 
</code></pre>

<p>[root@localhost ansible]# yum install python2-dnf </p>

<pre><code>Yum command has been deprecated, redirecting to '/usr/bin/dnf install python2-dnf'. 
See 'man dnf' and 'man yum2dnf' for more information. 
To transfer transaction metadata from yum to DNF, run: 
'dnf install python-dnf-plugins-extras-migrate &amp;&amp; dnf-2 migrate'

Last metadata expiration check: 0:12:08 ago on Tue Oct 18 04:57:11 2016.
Package python2-dnf-1.1.9-2.fc24.noarch is already installed, skipping.
Dependencies resolved. 
Nothing to do. 
Complete!
</code></pre>