Skip to content
Snippets Groups Projects
Commit ea6cfadc authored by Jafar Lie's avatar Jafar Lie
Browse files

Merge branch 'lmod_changes' into 'master'

Lmod changes

See merge request !458
parents ba36c885 3e173a00
No related branches found
No related tags found
1 merge request!458Lmod changes
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
when: default_modules == "modulecmd" when: default_modules == "modulecmd"
- name: template lmod bash - name: template lmod bash
template: src=lmod.sh.j2 dest=/etc/profile.d/lmod.sh template: src=lmod_{{ ansible_os_family }}.sh.j2 dest=/etc/profile.d/lmod.sh
become: true become: true
become_user: root become_user: root
when: default_modules == "lmod" when: default_modules == "lmod"
- name: template lmod csh - name: template lmod csh
template: src=lmod.csh.j2 dest=/etc/profile.d/lmod.csh template: src=lmod_{{ ansible_os_family }}.csh.j2 dest=/etc/profile.d/lmod.csh
become: true become: true
become_user: root become_user: root
when: default_modules == "lmod" when: default_modules == "lmod"
......
lmod.csh.j2
\ No newline at end of file
#!/bin/sh
# -*- shell-script -*-
########################################################################
# This is the system wide source file for setting up
# modules:
#
########################################################################
if [ -z "${USER_IS_ROOT:-}" ]; then
if [ -z "${MODULEPATH_ROOT:-}" ]; then
export USER=${USER-${LOGNAME}} # make sure $USER is set
export LMOD_sys=`uname`
LMOD_arch=`uname -m`
if [ "x$LMOD_sys" = xAIX ]; then
LMOD_arch=rs6k
fi
export LMOD_arch
export MODULEPATH_ROOT="/usr/modulefiles:/usr/local/Modulefiles"
export LMOD_SETTARG_CMD=":"
export LMOD_FULL_SETTARG_SUPPORT=no
export LMOD_COLORIZE=yes
export LMOD_PREPEND_BLOCK=normal
MODULEPATH=`sed -n 's/[ #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' /etc/lmod/modulespath`
export MODULEPATH=/usr/local/Modules/modulefiles/:$MODULEPATH
export MODULESHOME=/usr/share/lmod/lmod
export BASH_ENV=$MODULESHOME/init/bash
#
# If MANPATH is empty, Lmod is adding a trailing ":" so that
# the system MANPATH will be found
if [ -z "${MANPATH:-}" ]; then
export MANPATH=:
fi
export MANPATH=$(/usr/share/lmod/lmod/libexec/addto MANPATH /usr/share/lmod/lmod/share/man)
fi
PS_CMD=/bin/ps
if [ ! -x $PS_CMD ]; then
if [ -x /bin/ps ]; then
PS_CMD=/bin/ps
elif [ -x /usr/bin/ps ]; then
PS_CMD=/usr/bin/ps
fi
fi
EXPR_CMD=/usr/bin/expr
if [ ! -x $EXPR_CMD ]; then
if [ -x /usr/bin/expr ]; then
EXPR_CMD=/usr/bin/expr
elif [ -x /bin/expr ]; then
EXPR_CMD=/bin/expr
fi
fi
BASENAME_CMD=/usr/bin/basename
if [ ! -x $BASENAME_CMD ]; then
if [ -x /bin/basename ]; then
BASENAME_CMD=/bin/basename
elif [ -x /usr/bin/basename ]; then
BASENAME_CMD=/usr/bin/basename
fi
fi
my_shell=$($PS_CMD -p $$ -ocomm=)
my_shell=$($EXPR_CMD "$my_shell" : '-*\(.*\)')
my_shell=$($BASENAME_CMD $my_shell)
if [ -f /usr/share/lmod/lmod/init/$my_shell ]; then
. /usr/share/lmod/lmod/init/$my_shell >/dev/null # Module Support
else
. /usr/share/lmod/lmod/init/sh >/dev/null # Module Support
fi
unset my_shell PS_CMD EXPR_CMD BASENAME_CMD
fi
# Local Variables:
# mode: shell-script
# indent-tabs-mode: nil
# End:
lmod.csh.j2
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment