Skip to content
Snippets Groups Projects
Commit 732e81eb authored by Chris Hines's avatar Chris Hines
Browse files

Merge pull request #90 from l1ll1/master

lua modules and make slurm-from-source work a bit better on ubutnu
parents 8a0e913e fdc90e12
No related branches found
No related tags found
No related merge requests found
Showing
with 156 additions and 8 deletions
---
- name: Install tmux
apt: name=tmux state=latest
sudo: true
---
- include_vars: "{{ ansible_os_family }}.yml"
- name: install lua
yum: name={{ item }} state=installed
with_items:
- lua
- lua-filesystem
- lua-posix
sudo: true
when: ansible_os_family == 'RedHat'
- name: install lua
apt: name={{ item }} state=installed
with_items:
- lua5.2
- lua5.2
- lua-filesystem
- lua-bitop
- lua-posix
- liblua5.2-0
- liblua5.2-dev
- tcl
sudo: true
when: ansible_os_family == 'Debian'
- name: link bash
file: src={{ soft_dir }}/lmod/lmod/init/bash dest=/etc/profile.d/lmod.sh state=link
sudo: true
- name: link csh
file: src={{ soft_dir }}/lmod/lmod/init/cshrc dest=/etc/profile.d/lmod.csh state=link
sudo: true
---
lua_include: /usr/include/lua5.2
---
lua_include: /usr/local
---
source_dir: /tmp
soft_dir: /usr/local
lmod_version: 5.8.6
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDOzj+PSIuuGMOkMK4UO01Y1d8+6jGYELM+msVDpeSCZCAYCqYzXay6QDl5IFpdlxlhWXzcsfbC8WcHy3z+jW6kP6BcqZd7+eYrZVcWeO9A+p67OcsOHw5ixhCjFlXKxX/3D4JeppQeIUswI33zw90QViAlOPsTQuvIIuNNKQhUvfTVvkljduFXNT3xjLWai+isYKWaCbfmaiQ7EQIQyX9a3RrBKcEsLbghk3UkSq/j1OlMTbIuBKfPu26slPNRQFVBjJJfkx+kFF9ArgywHDN5dX3CxGOJhC2KIBemOC5cXjUbUI15a1UReDqShhb0m4p9pTkFOexGOB17lh1/4nUuYt2xzRahNyAEz9i02eIaVkhYFjVn1OuKJ7pa44YwoGx8RmFjRp8W/i3Crbp/IqBzMCfOZmub98b0I7H9ryg+taACRga6sLqWTDrEAbj7zFmRaaOHDIvrFj5ITO4YKYwSaWKL8w19NX4VJqzO3VVHbmUxFBoK4tGDAQ39w6BfRdxdKb+FIe+MOz68k4ADKHJSf9+LCQOFEikKNkKVUNh7FjLwi5Wz7K4S5wjnrjTUiqNC5imst262UJjtTeg7wE7ngPOlpSi1Mh4pV3/tcAboiRF8ABS/P8P0chln1YbA73x45ZF/Is9XQ2XUJiUwutrcY+upRdu2p9JAeKxGrt8i7w== root@autht
---
- name: restart ssh debian
service: name=ssh state=restarted
sudo: true
when: ansible_os_family == "Debian"
---
- name: copy ca cert
copy: src=server_ca.pub dest=/etc/ssh/server_ca.pub owner=root group=root mode=644
sudo: true
- name: edit sshd_config
lineinfile:
args:
dest: /etc/ssh/sshd_config
line: TrustedUserCAKeys /etc/ssh/server_ca.pub
state: present
sudo: true
notify: restart ssh debian
when: ansible_os_family == "Debian"
---
- name: stat usrlocal
stat: path={{ dest }}
register: stat_usrlocal
- name: mv
command: mv /usr/local /usr/local_old
when: stat_usrlocal.stat.isdir == True
sudo: true
- name: link
file: src="{{ src }}" dest="{{ dest }}" state=link
sudo: true
---
- include_vars: "{{ ansible_os_family }}.yml"
- name: install lua
yum: name={{ item }} state=installed
with_items:
- lua
- lua-filesystem
- lua-posix
sudo: true
when: ansible_os_family == 'RedHat'
- name: install lua
apt: name={{ item }} state=installed
with_items:
- lua5.2
- lua5.2
- lua-filesystem
- lua-bitop
- lua-posix
- liblua5.2-0
- liblua5.2-dev
- tcl
sudo: true
when: ansible_os_family == 'Debian'
- name: Download LMOD
get_url:
url=http://downloads.sourceforge.net/project/lmod/Lmod-{{ lmod_version }}.tar.bz2
dest={{source_dir}}/Lmod-{{ lmod_version }}.tar.bz2
mode=0444
- name: Uncompress LMOD
unarchive:
src={{ source_dir }}/Lmod-{{ lmod_version }}.tar.bz2
dest={{ source_dir }}
copy=no
creates={{source_dir}}/Lmod-{{ lmod_version }}/README
- name: Compile and install Lmod
shell: cd {{ source_dir }}/Lmod-{{ lmod_version }}; ./configure --prefix={{ soft_dir }} --with-mpathSearch=YES --with-caseIndependentSorting=YES && make install LUA_INCLUDE={{ lua_include }}
args:
creates: "{{ soft_dir }}/lmod/{{ lmod_version }}"
sudo: true
---
lua_include: /usr/include/lua5.2
---
lua_include: /usr/local
---
source_dir: /tmp
soft_dir: /usr/local
lmod_version: 5.8.6
......@@ -14,4 +14,14 @@
args:
dest: /usr/share/Modules/init/.modulespath
line: /usr/local/Modules/modulefiles
ignore_errors: true
sudo: true
# for some reason ubuntu uses lowercase modules
- name: add /usr/local/Modules to the module file path
lineinfile:
args:
dest: /usr/share/modules/init/.modulespath
line: /usr/local/Modules/modulefiles
ignore_errors: true
sudo: true
......@@ -4,5 +4,5 @@
sudo: true
- name: provision cron job
cron: name=provision job={{ provision }} user=root minute=*/5 state=present
cron: name=provision job="/usr/bin/flock -x -n /tmp/provision.lck -c {{ provision }}" user=root minute=*/30 state=present
sudo: true
......@@ -3,6 +3,8 @@
HOME_DIR={{ home_dir }}
user_list=($(getent passwd | cut -d ":" -f1))
log_file="/root/slurm.log"
export PATH=$PATH:{{ slurm_dir }}/bin
sacctmgr=$( which sacctmgr )
for user in ${user_list[*]}; do
{% if project_check is defined %}
......@@ -24,15 +26,15 @@ for user in ${user_list[*]}; do
find=$(sacctmgr list cluster ${cluster} | grep ${cluster})
if [ -z "${find}" ]; then
su slurm -c "sacctmgr -i add cluster ${cluster}" || { echo "error to create cluster ${cluster}" >> ${log_file} && exit 1; }
su slurm -c "$sacctmgr -i add cluster ${cluster}" || { echo "error to create cluster ${cluster}" >> ${log_file} && exit 1; }
fi
find=$(sacctmgr list account ${account} | grep ${account})
if [ -z "${find}" ]; then
su slurm -c "sacctmgr -i add account ${account} Description=CVL Organization=monash cluster=${cluster}" || { echo "error to create account ${account}" >> ${log_file} && exit 1; }
su slurm -c "$sacctmgr -i add account ${account} Description=CVL Organization=monash cluster=${cluster}" || { echo "error to create account ${account}" >> ${log_file} && exit 1; }
fi
find=$(sacctmgr list user ${user} | grep ${user})
if [ -z "${find}" ]; then
su slurm -c "sacctmgr -i add user ${user} account=${account} cluster=${cluster}" || { echo "error to create user ${user}" >> ${log_file} && exit 1; }
su slurm -c "$sacctmgr -i add user ${user} account=${account} cluster=${cluster}" || { echo "error to create user ${user}" >> ${log_file} && exit 1; }
fi
fi
fi
......
---
slurm_provision: /root/slurm_provision.sh
......@@ -11,7 +11,9 @@
- cgmanager
- cgmanager-utils
- libcgmanager0
sudo: true
when: ansible_os_family == "Debian"
sudo: true
- name: config cgroup.conf file
template: dest={{ slurm_dir }}/etc/cgroup.conf src=cgroup.conf.j2 mode=644
......
......@@ -21,6 +21,10 @@
args:
chdir: /tmp/warewulf-nhc-{{ nhc_version }}
- name: ensure sysconfig dir exists
file: dest=/etc/sysconfig state=directory owner=root group=root mode=755
sudo: true
- name: copy nhc sysconfig script
template: dest=/etc/sysconfig/nhc src=nhc.sysconfig.j2 mode=644
sudo: true
......@@ -39,7 +43,7 @@
register: generate_nhc_config_file
- name: generate config file
shell: "{{ nhc_dir }}/sbin/nhc-genconf"
shell: "{{ nhc_dir }}/sbin/nhc-genconf -d -c {{ nhc_dir }}/etc/nhc/{{ nhc_config_file }} CONFDIR={{ nhc_dir }}/etc/nhc"
sudo: true
when: generate_nhc_config_file
......
......@@ -87,6 +87,7 @@
- mysql-client
- python-mysqldb
- libmysqlclient-dev
- lua5.2
when: ansible_os_family == "Debian"
- include: installMungeFromSource.yml
......@@ -134,7 +135,7 @@
template: src=slurm.conf.j2 dest={{ slurm_dir }}/etc/slurm.conf
sudo: true
notify: restart slurm
when: slurm_use_vpn==False
when: slurm_use_vpn==False
- name: install slurm.conf
template: src=slurm-vpn.conf.j2 dest={{ slurm_dir }}/etc/slurm.conf
......@@ -151,7 +152,7 @@
delegate_to: "{{ slurmctrl }}"
run_once: true
sudo: true
when: slurm_lua
when: slurm_lua is defined
- include: installCgroup.yml
- include: installNhc.yml
......
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