Skip to content

Commit

Permalink
prepend slurm binaries to PATH instead of symlinking
Browse files Browse the repository at this point in the history
  • Loading branch information
sjpb committed Jul 25, 2024
1 parent 513516c commit a34dace
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions tasks/install-generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,15 @@
command: systemctl daemon-reload # noqa: command-instead-of-module no-changed-when no-handler
when: _slurm_systemd_units.changed

- name: Find user binaries
find:
paths: "{{ openhpc_bin_dir }}"
register: _ohpc_binaries

- name: Symlink slurm user binaries into $PATH
file:
src: "{{ item.path }}"
state: link
dest: "{{ ('/usr/bin', item.path | basename) | path_join }}"
- name: Prepend $PATH with slurm user binary location
lineinfile:
path: /etc/environment
line: "{{ new_path }}"
regexp: "^{{ new_path | regex_escape }}"
owner: root
group: root
mode: u=rwx,go=rx
force: true # files may already exist
loop: "{{ _ohpc_binaries.files }}"
loop_control:
label: "{{ item.path }}"
mode: u=gw,go=r
vars:
new_path: PATH="{{ openhpc_bin_dir }}:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin"

- meta: reset_connection # to get new environment

0 comments on commit a34dace

Please sign in to comment.