I tried removing the args and executable, then while trying to execute
again I am getting an error below.
{"changed": true, "cmd": "which java", "delta": "0:00:00.074712", "end":
"2019-01-23 13:41:10.748039", "msg": "non-zero return code", "rc": 1,
"start": "2019-01-23 13:41:10.673327", "stderr": "which: no java in
(/usr/bin:/bin:/usr/sbin:/sbin)", "stderr_lines": ["which: no java in
(/usr/bin:/bin:/usr/sbin:/sbin)"], "stdout": "", "stdout_lines": []}
Kindly help.
Ruben
On Wednesday, 23 January 2019 02:06:43 UTC+5:30, Kai Stian Olstad wrote:
>
> On Tuesday, 22 January 2019 16:05:06 CET ruben melvin wrote:
> > Hi guys,
> >
> > I am trying to execute below ansible playbook.
> >
> > ---
> > - name: "checking the java version"
> > hosts: host
> > remote_user: myremoteuser
> > gather_facts: False
> > become: yes
> > become_user: serveruser
> > become_method: 'sudo'
> >
> > tasks:
> > - name: which java
> > shell: which java
> > args:
> > executable: /usr/java/
> > register: java
>
> Here you are trying to run the directory /usr/java/
> just remove the args and executable and it should work.
>
>
> --
> Kai Stian Olstad
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/527b1756-839f-4b6d-9660-ee6745f7aa71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.