# i want to use environments variables of the remote host .

**URL:** <https://forum.ansible.com/t/i-want-to-use-environments-variables-of-the-remote-host/21315>\
**Category:** Ansible Project\
**Created:** [April 29, 2016, 12:36pm UTC](https://forum.ansible.com/t/i-want-to-use-environments-variables-of-the-remote-host/21315 "2016-04-29T12:36:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imed\_khaskhoussi](https://avatars.discourse-cdn.com/v4/letter/i/919ad9/32.png) [@imed\_khaskhoussi](https://forum.ansible.com/u/imed_khaskhoussi)\
**Post date:** [April 29, 2016, 12:36pm UTC](https://forum.ansible.com/t/i-want-to-use-environments-variables-of-the-remote-host/21315/1 "2016-04-29T12:36:51Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Anderson\_Chad](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@Anderson\_Chad](https://forum.ansible.com/u/Anderson_Chad)\
**Post date:** [April 29, 2016, 4:05pm UTC](https://forum.ansible.com/t/i-want-to-use-environments-variables-of-the-remote-host/21315/2 "2016-04-29T16:05:11Z")

</div>

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}.
