Install multiple rpms from local filesysyem with yum module

1,093 views
Skip to first unread message

SatIng

unread,
May 23, 2017, 6:57:58 PM5/23/17
to Ansible Development
I am trying to install Libreoffice using ansible yum module

Extracted and all libreoffice rpms kept at /home//LibreOffice_4.4.1.2_Linux_x86-64_rpm/RPMS/


- yum: 
        name: "/home/LibreOffice_4.4.1.2_Linux_x86-64_rpm/RPMS/*.rpm"
        state: present

above task failing with error
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "No Package file matching '/home/LibreOffice_4.4.1.2_Linux_x86-64_rpm/RPMS/*.rpm' found on system", "rc": 0, "results": []}

Need help

Matt Martz

unread,
May 23, 2017, 7:12:45 PM5/23/17
to Ansible Development, SatIng
Look into using with_fileglob for looping over a list of local files.


--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Matt Martz
@sivel
sivel.net

SatIng

unread,
May 23, 2017, 7:28:36 PM5/23/17
to Ansible Development, sati...@gmail.com

Worked...!!

- yum: 
        name: {{ item }}
        state: present
  with_fileglob:
        - "/home/LibreOffice_4.4.1.2_Linux_x86-64_rpm/RPMS/*.rpm"
        


Thanks Matt Martz
Reply all
Reply to author
Forward
0 new messages