# PATH env

**URL:** <https://forum.ansible.com/t/path-env/28709>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [October 2, 2018, 8:58pm UTC](https://forum.ansible.com/t/path-env/28709 "2018-10-02T20:58:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Duran](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@Jorge\_Duran](https://forum.ansible.com/u/Jorge_Duran)\
**Post date:** [October 2, 2018, 8:58pm UTC](https://forum.ansible.com/t/path-env/28709/1 "2018-10-02T20:58:20Z")

</div>

Hey guys,

very new to ansible and still learning Linux. I am creating a playbook to setup an High Performance Cluster, but as part of it i need to add some folders to the path for all users on a bunch of RHEL 7 boxes. Is there a module for this in ansible?

---

<div class="post-metadata">

**Author:** ![Kuldip\_Madnani1](https://avatars.discourse-cdn.com/v4/letter/k/91b2a8/32.png) [@Kuldip\_Madnani1](https://forum.ansible.com/u/Kuldip_Madnani1)\
**Post date:** [October 2, 2018, 9:03pm UTC](https://forum.ansible.com/t/path-env/28709/2 "2018-10-02T21:03:43Z")

</div>

file module

---

<div class="post-metadata">

**Author:** ![Brad2](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Brad2](https://forum.ansible.com/u/Brad2)\
**Post date:** [October 3, 2018, 12:39pm UTC](https://forum.ansible.com/t/path-env/28709/3 "2018-10-03T12:39:37Z")

</div>

There are several. File module as Kuldip suggested. lineinfile is another. replace is another. Your best bet is to change /etc/profile. Easiest way is to copy and edit as how you want. Place in your files directory and then just use the copy module to copy it to the target systems. That way is the simplest and you guarantee all systems will have the same /etc/profile.

Regards,

Brad

---

<div class="post-metadata">

**Author:** ![Jorge\_Duran](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@Jorge\_Duran](https://forum.ansible.com/u/Jorge_Duran)\
**Post date:** [October 4, 2018, 12:03am UTC](https://forum.ansible.com/t/path-env/28709/4 "2018-10-04T00:03:50Z")

</div>

Thanks guys in ended up using lininfile since i just wanted it at the bottom of the profile. Including the command just incase anyone else wants to see the format.

- name: Add a line to profile  
lineinfile:  
path: /etc/profile  
line: PATH=:$PATH
