# setting/accessing PATH

**URL:** <https://forum.ansible.com/t/setting-accessing-path/11996>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [October 18, 2012, 11:27am UTC](https://forum.ansible.com/t/setting-accessing-path/11996 "2012-10-18T11:27:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 18, 2012, 11:27am UTC](https://forum.ansible.com/t/setting-accessing-path/11996/1 "2012-10-18T11:27:07Z")

</div>

Can you clarify about what you mean by the PATH is not being set  
correctly? Ansible does not modify the path at all.

The shell module executes things through the actual shell.

If you want to set the PATH through the shell, you set it with  
PATH=foo prefixing the command, just like you can do in the normal  
shell.

"ruby\_path:/binary" looks completely foreign to me.

--Michael

---

<div class="post-metadata">

**Author:** ![Toby\_Hede](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@Toby\_Hede](https://forum.ansible.com/u/Toby_Hede)\
**Post date:** [October 18, 2012, 10:02pm UTC](https://forum.ansible.com/t/setting-accessing-path/11996/2 "2012-10-18T22:02:54Z")

</div>

I think I transposed my action poorly.

I am basically using the full path to the required binaries

action shell chdir=$app\_path /usr/local/ruby/bin/bundle

If I leave off the full path, the user that ansible is running under can’t find the “bundle” exec.

Working with some inherited chef stuff that explicitly runs using full paths, but wondering what the idiomatic ansible is. Is there a way to set the path once for ansible?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 18, 2012, 10:03pm UTC](https://forum.ansible.com/t/setting-accessing-path/11996/3 "2012-10-18T22:03:50Z")

</div>

Setting it once?

[http://www.joshstaiger.org/archives/2005/07/bash\_profile\_vs.html](http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html)

---

<div class="post-metadata">

**Author:** ![Toby\_Hede](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@Toby\_Hede](https://forum.ansible.com/u/Toby_Hede)\
**Post date:** [October 22, 2012, 10:32pm UTC](https://forum.ansible.com/t/setting-accessing-path/11996/4 "2012-10-22T22:32:24Z")

</div>

That’s what I figured I needed to do, but for some reason the Ansible shell agent just doesn’t pick up the bash\_profile.

I will keep playing, at least I know I am on the right track. Cheers.
