# How do you set the path variable?

**URL:** <https://forum.ansible.com/t/how-do-you-set-the-path-variable/14718>\
**Category:** Ansible Project\
**Created:** [March 6, 2014, 9:28pm UTC](https://forum.ansible.com/t/how-do-you-set-the-path-variable/14718 "2014-03-06T21:28:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hindenburg](https://avatars.discourse-cdn.com/v4/letter/h/439d5e/32.png) [@hindenburg](https://forum.ansible.com/u/hindenburg)\
**Post date:** [March 6, 2014, 9:28pm UTC](https://forum.ansible.com/t/how-do-you-set-the-path-variable/14718/1 "2014-03-06T21:28:50Z")

</div>

I’m trying to set the path variable in ansible

- name: Export env variables  
shell: export PATH=“PATH=/b/local/bin:/b/bin:$PATH”

- shell: echo $PATH  
register: foo

- debug: msg=“the echo was {{ foo.stdout }}”

But when I echo the path, it doesn’t contain the paths I appended. Is there a way I can set the path variable for the execution of the yaml file?

---

<div class="post-metadata">

**Author:** ![tannerjc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/tannerjc/32/985_2.png) [@tannerjc](https://forum.ansible.com/u/tannerjc)\
**Post date:** [March 6, 2014, 11:18pm UTC](https://forum.ansible.com/t/how-do-you-set-the-path-variable/14718/2 "2014-03-06T23:18:24Z")

</div>

[http://docs.ansible.com/playbooks\_environment.html](http://docs.ansible.com/playbooks_environment.html)
