Ansible Yum module to install multiple RPMs from local filesystem

129 views
Skip to first unread message

SatIng

unread,
May 25, 2017, 11:54:40 AM5/25/17
to Ansible Project
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

Kai Stian Olstad

unread,
May 25, 2017, 4:01:28 PM5/25/17
to ansible...@googlegroups.com
- find:
paths: /home/LibreOffice_4.4.1.2_Linux_x86-64_rpm/RPMS
patterns: *.rpm
register: file_list

- yum
name: "{{ file_list.files | map(attribute='path') | list }}"


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages