Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ohpc app installs #367

Open
wants to merge 3 commits into
base: uab-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@
cod_deploy: true
post_create_script: PostAddUserScript.sh

#Modulefiles path
module_script: "/etc/profile.d/modules.sh"
module_csh: "/etc/profile.d/modules.csh"

# Lmod
lmod_loc: "/opt/ohpc/admin/lmod/lmod"
lmod_archive_loc: "{{ cluster_shared_folder }}/rc/lmod"
Expand Down
13 changes: 4 additions & 9 deletions roles/ohpc_ansys/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
state: directory
mode: 0755
with_items: "{{ ansys_versions }}"


- name: Install ansys (Executable file to run xfce4desktop)
template:
Expand All @@ -25,30 +24,26 @@
dest: "{{ ansys_modulefiles_dir }}/{{ item }}"
with_items: "{{ ansys_versions }}"


- name: Check if modulefiles path is in default MODULEPATH
shell: grep "{{ cluster_shared_folder }}/modulefiles" /etc/profile.d/lmod.sh
shell: grep "{{ cluster_shared_folder }}/modulefiles" {{ module_script }}
ignore_errors: yes
register: default_modulepath_sh

- shell: grep "{{ cluster_shared_folder }}/modulefiles" /etc/profile.d/lmod.csh
- shell: grep "{{ cluster_shared_folder }}/modulefiles" {{ module_csh }}
ignore_errors: yes
register: default_modulepath_csh

- name: Add modulefiles path into default MODULEPATH
replace:
path: /etc/profile.d/lmod.sh
path: {{ module_script }}
regexp: '(MODULEPATH=.*)'
replace: '\1:{{ cluster_shared_folder }}/modulefiles'
backup: yes
when: default_modulepath_sh.stdout == ""

- replace:
path: /etc/profile.d/lmod.csh
path: {{ module_csh }}
regexp: '(MODULEPATH "[^"]*)'
replace: '\1:{{ cluster_shared_folder }}/modulefiles'
backup: yes
when: default_modulepath_csh.stdout == ""

- name: Update file in warewulf file database
command: wwsh file sync
11 changes: 4 additions & 7 deletions roles/ohpc_igv/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,25 @@
with_items: "{{ igv_versions }}"

- name: Check if modulefiles path is in default MODULEPATH
shell: grep "{{ cluster_shared_folder }}/modulefiles" /etc/profile.d/lmod.sh
shell: grep "{{ cluster_shared_folder }}/modulefiles" {{ module_script }}
ignore_errors: yes
register: default_modulepath_sh

- shell: grep "{{ cluster_shared_folder }}/modulefiles" /etc/profile.d/lmod.csh
- shell: grep "{{ cluster_shared_folder }}/modulefiles" {{ module_csh }}
ignore_errors: yes
register: default_modulepath_csh

- name: Add modulefiles path into default MODULEPATH
replace:
path: /etc/profile.d/lmod.sh
path: {{ module_script }}
regexp: '(MODULEPATH=.*)'
replace: '\1:{{ cluster_shared_folder }}/modulefiles'
backup: yes
when: default_modulepath_sh.stdout == ""

- replace:
path: /etc/profile.d/lmod.csh
path: {{ module_csh }}
regexp: '(MODULEPATH "[^"]*)'
replace: '\1:{{ cluster_shared_folder }}/modulefiles'
backup: yes
when: default_modulepath_csh.stdout == ""

- name: Update file in warewulf file database
command: wwsh file sync