# Source environment file on connection

**URL:** <https://forum.ansible.com/t/source-environment-file-on-connection/26373>\
**Category:** Ansible Project\
**Created:** [December 24, 2017, 10:35am UTC](https://forum.ansible.com/t/source-environment-file-on-connection/26373 "2017-12-24T10:35:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Richard\_Shaw](https://forum.ansible.com/u/Richard_Shaw)\
**Post date:** [December 24, 2017, 10:35am UTC](https://forum.ansible.com/t/source-environment-file-on-connection/26373/1 "2017-12-24T10:35:14Z")

</div>

Hi,

I’m working with a environment that requires a $ source /path/environment file every time Ansible connects so it can find Python etc, how would I go about doing that?

Thanks,  
Richard

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [December 24, 2017, 1:33pm UTC](https://forum.ansible.com/t/source-environment-file-on-connection/26373/2 "2017-12-24T13:33:57Z")

</div>

I would log in to a representative machine, do the source command and then examine what environment variables have been set, and then configure environment for any commands that need it.  
See [http://docs.ansible.com/ansible/latest/playbooks\_environment.html](http://docs.ansible.com/ansible/latest/playbooks_environment.html)

Jon
