# ansible yum module question

**URL:** <https://forum.ansible.com/t/ansible-yum-module-question/15935>\
**Category:** Ansible Project\
**Created:** [August 13, 2014, 6:40pm UTC](https://forum.ansible.com/t/ansible-yum-module-question/15935 "2014-08-13T18:40:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nic\_Flores](https://avatars.discourse-cdn.com/v4/letter/n/f04885/32.png) [@Nic\_Flores](https://forum.ansible.com/u/Nic_Flores)\
**Post date:** [August 13, 2014, 6:40pm UTC](https://forum.ansible.com/t/ansible-yum-module-question/15935/1 "2014-08-13T18:40:47Z")

</div>

Hey folks,  
Is there a way that I can yum install every RPM package that live in a certain directory on my target machine?

For example, I am trying to translate the following command into an ansible command:

yum -y localinstall /mnt/iso/Packages/\*.rpm

Using the most obvious solution in my playbook:

command: yum -y localinstall /mnt/iso/Packages/\*.rpm

ansbile reports a change, but when I check the system the packages are not installed.

I’ve also tried:

yum: name=/mnt/iso/Packages/\*.rpm state=present

and I still get an this error:

TASK: [installing all from iso packages] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [192.168.56.101] =\> {“changed”: false, “failed”: true, “rc”: 0, “results”: }  
msg: No Package file matching ‘/mnt/iso/Packages/\*.rpm’ found on system

FATAL: all hosts have already failed – aborting

Any ideas on how I can accomplish this?

ansible --version  
ansible 1.7 (devel 82fd70b74d) last updated 2014/05/06 05:18:42 (GMT -600)

Thanks!

Nic

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [August 14, 2014, 11:49am UTC](https://forum.ansible.com/t/ansible-yum-module-question/15935/2 "2014-08-14T11:49:45Z")

</div>

Shelling out to the yum command could be used to do this, yes, though you will first need to make sure the RPMs are present on the remote machine.

“ansbile reports a change, but when I check the system the packages are not installed.”

ansible will always report a change when a command runs, try running it by hand and see what happens?

Usage of “changed\_when” can be used to control the “changed” response in Ansible.

For your last question, the yum module will not take local RPM path wildcards.
