# become\_user not loading environment settings

**URL:** <https://forum.ansible.com/t/become-user-not-loading-environment-settings/19870>\
**Category:** Ansible Project\
**Created:** [November 26, 2015, 11:10pm UTC](https://forum.ansible.com/t/become-user-not-loading-environment-settings/19870 "2015-11-26T23:10:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamie\_A](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@Jamie\_A](https://forum.ansible.com/u/Jamie_A)\
**Post date:** [November 26, 2015, 11:10pm UTC](https://forum.ansible.com/t/become-user-not-loading-environment-settings/19870/1 "2015-11-26T23:10:55Z")

</div>

I am using Ansible to automate the deployment of a BAR file to IBM Integration Bus v9.0.0.4 Here is my playbook

---

<div class="post-metadata">

**Author:** ![Markus\_Ellers](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Markus\_Ellers](https://forum.ansible.com/u/Markus_Ellers)\
**Post date:** [November 27, 2015, 5:09pm UTC](https://forum.ansible.com/t/become-user-not-loading-environment-settings/19870/2 "2015-11-27T17:09:55Z")

</div>

you need to indent the shell line:

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 27, 2015, 5:12pm UTC](https://forum.ansible.com/t/become-user-not-loading-environment-settings/19870/3 "2015-11-27T17:12:18Z")

</div>

in general Ansible avoids doing logins, this will prevent many env  
vars from loading, add to that the normal sudo behavior of also  
removing/ignoring existing env vars and you'll probably get a very  
'clean' environment.

You can use the 'environment' directive to set those vars for the task  
you have directly.
