i want to use variables from the remote host i tried to save for example the variable JAVA_HOME existing in the remote host in a file , but the file is empty .
ansible can't find this variable .
is there any configuration , module ... to use to manipulate the environments variables of the remote host ?
---
- name: java home
shell: chdir=/home echo $JAVA_HOME > TEST.txt
the value of $JAVA_HOME is /usr/jdk1.8.0_65 when i execute "echo $JAVA_HOME" directly in the remote host but when i use ansible i can't catch any thing .
thank you in advance .