I'm trying to add /usr/pgsql-10/bin to $PATH, since I want everybody who uses the machine, to be able to run the psql command.
Tried to follow this example:
- name: add {{extra_path}} to path
lineinfile:
dest: /etc/environment
state: present
backrefs: yes
regexp: 'PATH=(["]*)((?!.*?{{extra_path}}).*?)(["]*)$'
line: "PATH=\1\2:{{extra_path}}\3"
First of all, I don't quite understand how should I exactly modify this.
Should I replace just the extra_path or the whole {{extra_path}} with my path (/usr/pgsql-10/bin).
I tried either way and I get different errors.
To makes matters worse, my /etc/environment doesn't even contain PATH.