Can't find yum package even though it is available

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.

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

> 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.

Install it.

and try the command again.
-sv

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"

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