# source /etc/profile is not loading

**URL:** <https://forum.ansible.com/t/source-etc-profile-is-not-loading/27828>\
**Category:** Ansible Project\
**Created:** [June 20, 2018, 11:22am UTC](https://forum.ansible.com/t/source-etc-profile-is-not-loading/27828 "2018-06-20T11:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawan\_Kumar](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@Pawan\_Kumar](https://forum.ansible.com/u/Pawan_Kumar)\
**Post date:** [June 20, 2018, 11:22am UTC](https://forum.ansible.com/t/source-etc-profile-is-not-loading/27828/1 "2018-06-20T11:22:22Z")

</div>

Hi All,

I am using “action: shell source /etc/profile” and at the time of playbook execution its showing changed too, but somehow i am not able to see my environment variable when i run echo $JAVA\_HOME which is set under /etc/profile.  
On the other side if i run source /etc/profile manually, i can see the echo $JAVA\_HOME output.

Please suggest

Regards,  
Pawan Kumar

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [June 20, 2018, 11:49am UTC](https://forum.ansible.com/t/source-etc-profile-is-not-loading/27828/2 "2018-06-20T11:49:32Z")

</div>

Environment variables do not survive the death of the shell that sets them.

To pass an environment variable from shell to shell, you must either pass it in as a variable when invoking the second shell, or save it to a file which is sourced by the second shell.

​Regards, K.

​
