Skip to content

Commit a34dace

Browse files
committed
prepend slurm binaries to PATH instead of symlinking
1 parent 513516c commit a34dace

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

tasks/install-generic.yml

+10-15
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,15 @@
5858
command: systemctl daemon-reload # noqa: command-instead-of-module no-changed-when no-handler
5959
when: _slurm_systemd_units.changed
6060

61-
- name: Find user binaries
62-
find:
63-
paths: "{{ openhpc_bin_dir }}"
64-
register: _ohpc_binaries
65-
66-
- name: Symlink slurm user binaries into $PATH
67-
file:
68-
src: "{{ item.path }}"
69-
state: link
70-
dest: "{{ ('/usr/bin', item.path | basename) | path_join }}"
61+
- name: Prepend $PATH with slurm user binary location
62+
lineinfile:
63+
path: /etc/environment
64+
line: "{{ new_path }}"
65+
regexp: "^{{ new_path | regex_escape }}"
7166
owner: root
7267
group: root
73-
mode: u=rwx,go=rx
74-
force: true # files may already exist
75-
loop: "{{ _ohpc_binaries.files }}"
76-
loop_control:
77-
label: "{{ item.path }}"
68+
mode: u=gw,go=r
69+
vars:
70+
new_path: PATH="{{ openhpc_bin_dir }}:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"
71+
72+
- meta: reset_connection # to get new environment

0 commit comments

Comments
 (0)