I tried to install rpm in ansible control machine to target machines using playbook
- name: Install local rpm in server
yum: pkg=files/mod_jk-1.2.40-5.el6.x86_64.rpm state=present
when: ansible_os_family == 'RedHat'
I got error :
failed: [
xyz.cloudapp.net] => {"changed": false, "failed": true, "rc": 0, "results": []}
msg: No Package file matching 'files/mod_jk-1.2.40-5.el6.x86_64.rpm' found on system
When I copied the same file in server and installed as local installation it works.
- name: copy mod_jk rpm to server
copy: src=files/mod_jk-1.2.40-5.el6.x86_64.rpm dest=/home/user/mod_jk-1.2.40-5.el6.x86_64.rpm owner=user group=azureuser mode=755
when: ansible_os_family == 'RedHat'
- name: Install mod_jk local rpm in server
yum: name=/home/user/mod_jk-1.2.40-5.el6.x86_64.rpm state=present
when: ansible_os_family == 'RedHat'
Is there a way to directly install from control machine without copying it