# Yum failing on with\_items for target hosts (packages already installed)

**URL:** <https://forum.ansible.com/t/yum-failing-on-with-items-for-target-hosts-packages-already-installed/24046>\
**Category:** Ansible Project\
**Created:** [March 23, 2017, 4:16pm UTC](https://forum.ansible.com/t/yum-failing-on-with-items-for-target-hosts-packages-already-installed/24046 "2017-03-23T16:16:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James2](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@James2](https://forum.ansible.com/u/James2)\
**Post date:** [March 23, 2017, 4:16pm UTC](https://forum.ansible.com/t/yum-failing-on-with-items-for-target-hosts-packages-already-installed/24046/1 "2017-03-23T16:16:57Z")

</div>

Hi,

I’m sorry if this issue has been posted/discussed before, but I tried searching and couldn’t find anything related. I get the following output when I try to run a simple playbook.

[root@atk ansible]# ansible-playbook pre\_identix.yml --ask-become-pass  
SUDO password:

PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]  
ok: [192.168.1.20]  
ok: [192.168.1.18]  
ok: [192.168.1.19]

TASK [Ping all hosts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]  
ok: [192.168.1.18]  
ok: [192.168.1.20]  
ok: [192.168.1.19]

TASK [Verify SSH is installed] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]  
ok: [192.168.1.18]  
ok: [192.168.1.20]  
ok: [192.168.1.19]

TASK [Verify sshd service is enabled and running] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost]  
ok: [192.168.1.18]  
ok: [192.168.1.20]  
ok: [192.168.1.19]

TASK [Verify third-party packages are installed] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> (item=[u’libpng.x86\_64’, u’jasper-libs.x86\_64’, u’openjpeg-libs.x86\_64’, u’jq.x86\_64’, u’libtiff.x86\_64’, u’libX11.x86\_64’, u’unzip.x86\_64’])

failed: [192.168.1.18] (item=[u’libpng.x86\_64’, u’jasper-libs.x86\_64’, u’openjpeg-libs.x86\_64’, u’jq.x86\_64’, u’libtiff.x86\_64’, u’libX11.x86\_64’, u’unzip.x86\_64’]) =\> {“changed”: false, “failed”: true, “item”: [“libpng.x86\_64”, “jasper-libs.x86\_64”, “openjpeg-libs.x86\_64”, “jq.x86\_64”, “libtiff.x86\_64”, “libX11.x86\_64”, “unzip.x86\_64”], “msg”: “No package matching ‘jq.x86\_64’ found available, installed or updated”, “rc”: 126, “results”: [“libpng-2:1.5.13-7.el7\_2.x86\_64 providing libpng.x86\_64 is already installed”, “jasper-libs-1.900.1-29.el7.x86\_64 providing jasper-libs.x86\_64 is already installed”, “No package matching ‘jq.x86\_64’ found available, installed or updated”]}  
failed: [192.168.1.20] (item=[u’libpng.x86\_64’, u’jasper-libs.x86\_64’, u’openjpeg-libs.x86\_64’, u’jq.x86\_64’, u’libtiff.x86\_64’, u’libX11.x86\_64’, u’unzip.x86\_64’]) =\> {“changed”: false, “failed”: true, “item”: [“libpng.x86\_64”, “jasper-libs.x86\_64”, “openjpeg-libs.x86\_64”, “jq.x86\_64”, “libtiff.x86\_64”, “libX11.x86\_64”, “unzip.x86\_64”], “msg”: “No package matching ‘jq.x86\_64’ found available, installed or updated”, “rc”: 126, “results”: [“libpng-2:1.5.13-7.el7\_2.x86\_64 providing libpng.x86\_64 is already installed”, “jasper-libs-1.900.1-29.el7.x86\_64 providing jasper-libs.x86\_64 is already installed”, “No package matching ‘jq.x86\_64’ found available, installed or updated”]}  
failed: [192.168.1.19] (item=[u’libpng.x86\_64’, u’jasper-libs.x86\_64’, u’openjpeg-libs.x86\_64’, u’jq.x86\_64’, u’libtiff.x86\_64’, u’libX11.x86\_64’, u’unzip.x86\_64’]) =\> {“changed”: false, “failed”: true, “item”: [“libpng.x86\_64”, “jasper-libs.x86\_64”, “openjpeg-libs.x86\_64”, “jq.x86\_64”, “libtiff.x86\_64”, “libX11.x86\_64”, “unzip.x86\_64”], “msg”: “No package matching ‘jq.x86\_64’ found available, installed or updated”, “rc”: 126, “results”: [“libpng-2:1.5.13-7.el7\_2.x86\_64 providing libpng.x86\_64 is already installed”, “jasper-libs-1.900.1-29.el7.x86\_64 providing jasper-libs.x86\_64 is already installed”, “No package matching ‘jq.x86\_64’ found available, installed or updated”]}

NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
192.168.1.18 : ok=4 changed=0 unreachable=0 failed=1  
192.168.1.19 : ok=4 changed=0 unreachable=0 failed=1  
192.168.1.20 : ok=4 changed=0 unreachable=0 failed=1  
localhost : ok=5 changed=0 unreachable=0 failed=0

The manually ssh’d to a couple of the hosts and the packages it says are failing are already installed and updated, so why does Ansible return a failed status? My version of Ansible is ansible-2.2.1.0-1.el7.noarch. My playbook is below, for review.

---

<div class="post-metadata">

**Author:** ![Kenton\_Brede](https://avatars.discourse-cdn.com/v4/letter/k/db5fbb/32.png) [@Kenton\_Brede](https://forum.ansible.com/u/Kenton_Brede)\
**Post date:** [March 24, 2017, 1:39pm UTC](https://forum.ansible.com/t/yum-failing-on-with-items-for-target-hosts-packages-already-installed/24046/2 "2017-03-24T13:39:09Z")

</div>

The error message is telling you, “No package matching ‘jq.x86\_64’ found available, installed or updated.” Does running “yum install jq.x86\_64” result in the same error? If so, there’s a problem with the package name or the repo doesn’t contain that particular package.

---

<div class="post-metadata">

**Author:** ![James2](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@James2](https://forum.ansible.com/u/James2)\
**Post date:** [March 24, 2017, 1:48pm UTC](https://forum.ansible.com/t/yum-failing-on-with-items-for-target-hosts-packages-already-installed/24046/3 "2017-03-24T13:48:18Z")

</div>

Kenton,

I said in my original post that I ssh’d into a couple of the target hosts and ran the yum command manually. The output of that command said the package was already installed and no updates were available, so there seems to be no issue with the package name or the repo. If you notice, the ‘localhost’ results of the playbook are successful and it’s only the other three hosts that are not returning expected results.

Thanks  
James
