I am new to ansible and trying to copy and install jdk on remote machine. I would like to use rpm install only considering I have all different flavours of clients.(RHEL, Centos, Ubuntu etc). Below is my playbook
- hosts: all_clients
remote_user: root
tasks:
- name: copy jdk rpm on client machine usr/tmp
copy:
src: ./RPM/jdk8u73x64.rpm
dest: /usr/tmp/jdk8u73x64.rpm
- name: start installation of jdk
package:
name: /usr/tmp/jdk8u73x64.rpm
#name: jdk8u73x64.rpm
state: latest
#use: rpm
But I am getting below error.
TASK [setup] *******************************************************************
ok: [10.219.161.98]
TASK [copy jdk rpm on client machine usr/tmp] **********************************
ok: [10.219.161.98]
TASK [start installation of jdk] ***********************************************
fatal: [10.219.161.98]: FAILED! => {"changed": false, "failed": true, "msg": "No Package matching 'jdk8u73x64.rpm' found available, installed or updated", "rc": 0, "results": []}
NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @test2.retry
PLAY RECAP *********************************************************************
10.219.161.98 : ok=2 changed=0 unreachable=0 failed=1
Ansible package module description doesn't say much about where does it search for package on client machine. Can someone please help me to make it work?