- name: Find all rpm files in /tmp folder find: paths: "/root/tivo" pattern: "*.rpm" register: rpm_files - set_fact: rpm_list: "{{ rpm_files.files | map(attribute='path') | list}}" - name: installing the rpm files yum: name: "{{rpm_list}}" state: present