# Can't find yum package even though it is available

**URL:** <https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460>\
**Category:** Ansible Project\
**Created:** [March 6, 2013, 5:01am UTC](https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460 "2013-03-06T05:01:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curtis](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@Curtis](https://forum.ansible.com/u/Curtis)\
**Post date:** [March 6, 2013, 5:01am UTC](https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460/1 "2013-03-06T05:01:36Z")

</div>

So the package libvirt-devel is available on the server that I am running ansible against (Redhat 6.4).

[root@VIRT-V2V:~] $ yum search libvirt-devel  
Loaded plugins: product-id, rhnplugin, subscription-manager  
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.  
This system is receiving updates from RHN Classic or RHN Satellite.  
================================== N/S Matched: libvirt-devel ===================================  
libvirt-devel.i686 : Libraries, includes, etc. to compile with the libvirt library  
libvirt-devel.x86\_64 : Libraries, includes, etc. to compile with the libvirt library

Name and summary matches only, use “search all” for everything.

---

<div class="post-metadata">

**Author:** ![Seth\_Vidal](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@Seth\_Vidal](https://forum.ansible.com/u/Seth_Vidal)\
**Post date:** [March 6, 2013, 5:22am UTC](https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460/2 "2013-03-06T05:22:06Z")

</div>

Curtis - do you have yum-utils installed?

I suspect that this is an extremely fun interaction between the  
yum rhnplugin and the yum module in ansible.

-sv

---

<div class="post-metadata">

**Author:** ![Curtis](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@Curtis](https://forum.ansible.com/u/Curtis)\
**Post date:** [March 6, 2013, 5:24am UTC](https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460/3 "2013-03-06T05:24:55Z")

</div>

> \> So the package libvirt-devel is available on the server that I am  
> \> running ansible against (Redhat 6.4).  
> \>  
> \> [root@VIRT-V2V:~] $ yum search libvirt-devel  
> \> Loaded plugins: product-id, rhnplugin, subscription-manager  
> \> This system is not registered to Red Hat Subscription Management. You  
> \> can use subscription-manager to register.  
> \> This system is receiving updates from RHN Classic or RHN Satellite.  
> \> ================================== N/S Matched: libvirt-devel  
> \> ===================================  
> \> libvirt-devel.i686 : Libraries, includes, etc. to compile with the  
> \> libvirt library  
> \> libvirt-devel.x86\_64 : Libraries, includes, etc. to compile with the  
> \> libvirt library  
> \>  
> \> Name and summary matches only, use "search all" for everything.  
> \>  
> \> ==  
> \>  
> \> but ansible can't find it:  
> \>  
> \> SNIP!  
> \> TASK: [ensure correct packages are installed] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \> \<virt-v2v\> ESTABLISH CONNECTION FOR USER: root  
> \> \<virt-v2v\> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o',  
> \> 'ControlPersist=60s', '-o', 'ControlPath=/tmp/ansible-ssh-%h-%p-%r',  
> \> '-o', 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o',  
> \> 'KbdInteractiveAuthentication=no', '-o', 'PasswordAuthentication=no',  
> \> '-o', u'User=root', 'virt-v2v', "/bin/sh -c 'mkdir -p  
> \> $HOME/.ansible/tmp/ansible-1362545472.49-53051416371197 && echo  
> \> $HOME/.ansible/tmp/ansible-1362545472.49-53051416371197'"]  
> \> \<virt-v2v\> REMOTE\_MODULE yum name="libvirt-devel" state=latest  
> \> \<virt-v2v\>  
> \> PUT /var/folders/y6/tp2pwc4s4z51hr22ftyt2vg40000gn/T/tmpHxTF1B  
> \> TO /root/.ansible/tmp/ansible-1362545472.49-53051416371197/yum  
> \> \<virt-v2v\> EXEC ['ssh', '-tt', '-q', '-o', 'ControlMaster=auto',  
> \> '-o', 'ControlPersist=60s', '-o',  
> \> 'ControlPath=/tmp/ansible-ssh-%h-%p-%r', '-o',  
> \> 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o',  
> \> 'KbdInteractiveAuthentication=no', '-o', 'PasswordAuthentication=no',  
> \> '-o', u'User=root', 'virt-v2v', u"/bin/sh -c '/usr/bin/python  
> \> -tt /root/.ansible/tmp/ansible-1362545472.49-53051416371197/yum; rm  
> \> -rf /root/.ansible/tmp/ansible-1362545472.49-53051416371197/  
> \> \>/dev/null 2\>&1'"] failed: [virt-v2v] =\> {"changed": false, "failed":  
> \> \>true, "rc": 0, "results": } msg: No Package matching  
> \> \>'libvirt-devel' found available, installed or  
> \> updated  
> \>  
> \> FATAL: all hosts have already failed -- aborting  
> \>  
> \> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \> virt-v2v : ok=2 changed=1 unreachable=0  
> \> failed=1  
> \>  
> \> ==  
> \>  
> \> Am using ansible 1.0  
> \>  
> \> # ansible --version  
> \> ansible 1.0  
> \>  
> \> ==  
> \>  
> \> Thoughts on that one? I'm stumped.  
> \>
> 
> Curtis - do you have yum-utils installed?

Nopers, not on that server.

[root@VIRT-V2V:~] $ rpm -qa yum-utils  
[root@VIRT-V2V:~] $

Thanks,  
Curtis.

---

<div class="post-metadata">

**Author:** ![Seth\_Vidal](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@Seth\_Vidal](https://forum.ansible.com/u/Seth_Vidal)\
**Post date:** [March 6, 2013, 5:36am UTC](https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460/4 "2013-03-06T05:36:11Z")

</div>

Install it.

and try the command again.  
-sv

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 6, 2013, 4:45pm UTC](https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460/5 "2013-03-06T16:45:20Z")

</div>

Seeing the RHN plugin interaction fun,

I had this crazy idea that maybe if the yum module is running on RHEL5  
and sees no yum-utils, it just adds it to the package list for you.

Doesn't seem that terrible, it's essentially in the category of "self  
bootstrapping"

---

<div class="post-metadata">

**Author:** ![Seth\_Vidal](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@Seth\_Vidal](https://forum.ansible.com/u/Seth_Vidal)\
**Post date:** [March 6, 2013, 4:59pm UTC](https://forum.ansible.com/t/cant-find-yum-package-even-though-it-is-available/12460/6 "2013-03-06T16:59:15Z")

</div>

That would be all lovely and what-not except:

- if you're removing a pkg as your first action  
- if you're doing a not-install.

There's another way to fix this - it's more or less figuring out what  
is causing the rhnplugin to throwup. I have a few ideas of what it is  
but I don't have a system on which to easily test. I can set one up but  
I don't have the spare cycles right now to do that.

if there is anyone else who wants to test/patch this I would love to  
see patches.

-sv
