Host output to Ansible-control

Hey ,

I am trying to find out the java version of different host using this script

You would need to use register: on that task to store the output.
https://docs.ansible.com/ansible/playbooks_variables.html#registered-variables

Then you can make a new task with the template module.
https://docs.ansible.com/ansible/playbooks_templating.html

In the template you can create what you will by looping over all the hosts and print it there individual output.

The template task you would need to use "run_once: true" and "delegate_to: localhost" so it only run one time on the Ansible control machine.