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.



On Wed, Aug 13, 2014 at 2:40 PM, Nic Flores <flores...@gmail.com> wrote:

> 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
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8f906157-003c-4ccc-9ffa-7b14be28ca16%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/8f906157-003c-4ccc-9ffa-7b14be28ca16%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxueA_ZJ6V6qZWsBv5hQqRqVEpF1NRr3RGb16-k-1x74Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to