PATH env

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?

file module

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

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