# Yum module update\_cache doesn't work for RHEL in ansible 2.4.0.0

**URL:** <https://forum.ansible.com/t/yum-module-update-cache-doesnt-work-for-rhel-in-ansible-2-4-0-0/25977>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [November 9, 2017, 6:15pm UTC](https://forum.ansible.com/t/yum-module-update-cache-doesnt-work-for-rhel-in-ansible-2-4-0-0/25977 "2017-11-09T18:15:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kuldip\_Madnani](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@Kuldip\_Madnani](https://forum.ansible.com/u/Kuldip_Madnani)\
**Post date:** [November 9, 2017, 6:15pm UTC](https://forum.ansible.com/t/yum-module-update-cache-doesnt-work-for-rhel-in-ansible-2-4-0-0/25977/1 "2017-11-09T18:15:32Z")

</div>

The example shown in Ansible website shows that update\_cache is executed when ansible\_distribution is Centos.

- name: install system updates for centos systems yum: name=\* state=latest update\_cache=yes when: ansible\_distribution == “CentOS”

The exact same command works for us when we run it on Centos without the when condition, however it hangs up for hours in RHEL and finally outputs with a long error message depicting conflicts…

Does update\_cache work in RHEL?

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [November 9, 2017, 6:51pm UTC](https://forum.ansible.com/t/yum-module-update-cache-doesnt-work-for-rhel-in-ansible-2-4-0-0/25977/2 "2017-11-09T18:51:58Z")

</div>

It does. From your description, it sounds like the RHEL repository  
has a packageset that's generating conflicts in your install. the  
update\_cache is likely just making the error in the repository  
visible.

CentOS and RHEL pull from different repositories and don't always have  
the same set of packages at the same time (and you could also have  
different packages installed on the two machines which complicates  
things further).

A better test for diagnosing this would be whether using yum from the  
commandline (or via ansible's command module) on the RHEL box does the  
same thing or a different thing from the ansible command.

-Toshio

---

<div class="post-metadata">

**Author:** ![Kuldip\_Madnani](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@Kuldip\_Madnani](https://forum.ansible.com/u/Kuldip_Madnani)\
**Post date:** [November 9, 2017, 8:09pm UTC](https://forum.ansible.com/t/yum-module-update-cache-doesnt-work-for-rhel-in-ansible-2-4-0-0/25977/3 "2017-11-09T20:09:49Z")

</div>

I diagnosed it first by reverting the ansible version to 2.3.1.0 and it worked:

“changed”: false,  
“invocation”: {  
“module\_args”: {  
“conf\_file”: null,  
“disable\_gpg\_check”: false,  
“disablerepo”: null,  
“enablerepo”: null,  
“exclude”: null,  
“install\_repoquery”: true,  
“installroot”: “/”,  
“list”: null,  
“name”: [  
“\*”  
],  
“skip\_broken”: false,  
“state”: “installed”,  
“update\_cache”: true,  
“validate\_certs”: true  
}  
},  
“msg”: " Warning: Due to potential bad behaviour with rhnplugin and certificates, used slower repoquery calls instead of Yum API.",  
“rc”: 0,  
“results”: [  
“systemd-libs-219-42.el7\_4.1.x86\_64 providing \* is already installed”  
]  
}

I then went ahead and ran this command on the node “yum makecache” and it was successful.

so that’s the only reason i am thinking about ansible version.

This is the part of error i get with ansible 2.4.1.0:

[zldy1643.pdk1.cci.att.com](http://zldy1643.pdk1.cci.att.com) | FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“invocation”: {  
“module\_args”: {  
“allow\_downgrade”: false,  
“conf\_file”: null,  
“disable\_gpg\_check”: false,  
“disablerepo”: null,  
“enablerepo”: null,  
“exclude”: null,  
“install\_repoquery”: true,  
“installroot”: “/”,  
“list”: null,  
“name”: [  
“\*”  
],  
“security”: false,  
“skip\_broken”: false,  
“state”: “installed”,  
“update\_cache”: true,  
“validate\_certs”: true  
}  
},  
“msg”: "Error: zeromq3-devel conflicts with zeromq-devel-4.1.4-5.el7.x86\_64\nError: compat-qpid-cpp-client-rdma conflicts with qpid-cpp-client-rdma-1.36.0-1.el7.x86\_64\nError: dmlite-dpmhead-dome conflicts with dpm-srm-server-mysql-1.9.0-1.el7.x86\_64\nError: Package: bionetgen-2.2.5-2.el7.x86\_64 (epel)\n Requires: libsundials\_cvode.so.1()(64bit)\nError: Package: python2-eventlet-0.18.4-1.el7.noarch (epel)\n Requires: python-greenlet\nError: libcint conflicts with qcint-1.8.6-1.el7.x86\_64\nError: Package: python2-flask-multistatic-1.0-1.el7.noarch (epel)\n Requires: python-flask\nError: Package: python3-yamlordereddictloader-0.3.0-1.el7.noarch (epel)\n Requires: python3-PyYAML\nError: radcli-compat-devel conflicts with radiusclient-ng-devel-0.5.6-9.el7.x86\_64\nError: Package: python-flask-babel-0.9-2.el7.noarch (epel)\n
