# yum module not updating local rpm

**URL:** <https://forum.ansible.com/t/yum-module-not-updating-local-rpm/22165>\
**Category:** Ansible Project\
**Created:** [July 29, 2016, 6:06pm UTC](https://forum.ansible.com/t/yum-module-not-updating-local-rpm/22165 "2016-07-29T18:06:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_Torres](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@Giovanni\_Torres](https://forum.ansible.com/u/Giovanni_Torres)\
**Post date:** [July 29, 2016, 6:06pm UTC](https://forum.ansible.com/t/yum-module-not-updating-local-rpm/22165/1 "2016-07-29T18:06:21Z")

</div>

Running ansible 2.1.1.0 on CentOS 6.

I have a package (v5.5.0) that is installed on the remote host:

[remotehost ~] $ rpm -q mypkg  
mypkg-5.5.0-1.el6.x86\_64

I tried to use this command on the ansible server to update the package to v5.5.2 on the remotehost:

# ansible remotehost -m yum -a “name=/nfs/RPMS/mypkg-5.5.2-1.el6.x86\_64.rpm state=present” -vvvv

remotehost | SUCCESS =\> {  
“changed”: false,  
“invocation”: {  
“module\_args”: {  
“conf\_file”: null,  
“disable\_gpg\_check”: false,  
“disablerepo”: null,  
“enablerepo”: null,  
“exclude”: null,  
“install\_repoquery”: true,  
“list”: null,  
“name”: [  
“/nfs/RPMS/mypkg-5.5.2-1.el6.x86\_64.rpm”  
],  
“state”: “present”,  
“update\_cache”: false,  
“validate\_certs”: true  
},  
“module\_name”: “yum”  
},  
“msg”: “”,  
“rc”: 0,  
“results”:   
}

But the package doesn’t update. “changed” is false. It remains at 5.5.0, not 5.5.2 as expected.

If i try to change state to latest, I get the following error:

remotehost | FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“invocation”: {  
“module\_args”: {  
“conf\_file”: null,  
“disable\_gpg\_check”: false,  
“disablerepo”: null,  
“enablerepo”: null,  
“exclude”: null,  
“install\_repoquery”: true,  
“list”: null,  
“name”: [  
“/nfs/RPMS/mypkg-5.5.2-1.el6.x86\_64.rpm”  
],  
“state”: “latest”,  
“update\_cache”: false,  
“validate\_certs”: true  
},  
“module\_name”: “yum”  
},  
“msg”: “No Package matching ‘/nfs/RPMS/mypkg-5.5.2-1.el6.x86\_64.rpm’ found available, installed or updated”,  
“rc”: 0,  
“results”:   
}

But both machines mount this NFS share and I can stat the file on both the ansible server and the remotehost.

Am I missing something obvious?

Thanks,  
Giovanni

---

<div class="post-metadata">

**Author:** ![Artyom\_Aleksandrov](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@Artyom\_Aleksandrov](https://forum.ansible.com/u/Artyom_Aleksandrov)\
**Post date:** [August 5, 2016, 9:22pm UTC](https://forum.ansible.com/t/yum-module-not-updating-local-rpm/22165/2 "2016-08-05T21:22:50Z")

</div>

Check yum module documentation and take a look on state attribute.

[http://docs.ansible.com/ansible/yum\_module.html](http://docs.ansible.com/ansible/yum_module.html)

You use present which mean - check if package install and install if not.  
If you want to upgrade use latest.
