# bashrc or bash\_profile not being sourced

**URL:** <https://forum.ansible.com/t/bashrc-or-bash-profile-not-being-sourced/14707>\
**Category:** Ansible Project\
**Tags:** ee\
**Created:** [March 5, 2014, 1:08pm UTC](https://forum.ansible.com/t/bashrc-or-bash-profile-not-being-sourced/14707 "2014-03-05T13:08:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jepper](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jepper](https://forum.ansible.com/u/jepper)\
**Post date:** [March 5, 2014, 1:08pm UTC](https://forum.ansible.com/t/bashrc-or-bash-profile-not-being-sourced/14707/1 "2014-03-05T13:08:12Z")

</div>

I think this has been discussed before. The documentations says:

“If you want to run a command through the shell (say you are using \<, \>, |, etc), you actually want the shell module instead. The command module is much more secure as it’s not affected by the user’s environment.”

Implicitly, I read this as if I _do_ use the shell command, I should get the users environment. Is this assumption wrong?

Now I do this, occasionally, in order to include anything from my user profile:

shell: . ~/.bashrc && env \> /tmp/env

The use case I have is to install a mule license, which requires MULE\_HOME. I could write a two line wrapper, but I’d rather not have more parts than I can get away with. I do as follows:

shell: . ~/.bashrc && ./mule -installLicense {{ mule\_user\_home }}/mule-ee-license.lic chdir={{ mule\_home }}/bin

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [March 6, 2014, 4:00pm UTC](https://forum.ansible.com/t/bashrc-or-bash-profile-not-being-sourced/14707/2 "2014-03-06T16:00:07Z")

</div>

a few things:

- you have a hash in ansible\_env that shows what the environment is (for user you gathered facts as).
- ansible doesn’t source .rc files
- the environment: keyword lets you set env variables for the execution context.
