By default it is executing as /bin/sh so you'll want to add executable:
/bin/bash if you are accessing environment variables set in your
/etc/profile or ~/bash{_profile,rc}.

On Fri, Apr 29, 2016 at 5:36 AM, mondher khas <[email protected]> wrote:

> Hi there,
>
> 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 .
>
> --
> 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/ca1911a1-6e04-4e17-83be-ad19e9e9718c%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ca1911a1-6e04-4e17-83be-ad19e9e9718c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Chad Anderson
DevOps Engineer
DomainTools

[email protected]
www.domaintools.com

-- 
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/CADCir8MRX%3Dq9JZn4rSO9Mk%3DoPZmkYy%3DUa8Xi4JDMb-bpR5tcFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to