Would like to move to to https://github.com/rug-cit-hpc/pg-playbooks but has large files...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

107 lines
2.1 KiB

# Build and install a docker image for slurm.
---
- name: Install yum dependencies
yum: name={{ item }} state=latest update_cache=yes
with_items:
- docker-ce
- docker-python
- ntp
- name: set selinux in permissive mode to allow docker volumes
selinux:
policy: targeted
state: permissive
- name: install docker config
template:
src: files/daemon.json
dest: /etc/docker/daemon.json
- name: make sure service is started
systemd:
name: "{{item}}"
state: started
with_items:
- docker
- ntpd
- name: Make docker build dir
file:
path: /srv/slurm
state: directory
mode: 0755
- name: Make dirs to be used as a volumes
file:
path: "/srv/slurm/volumes{{item}}"
state: directory
mode: 0777
with_items:
- /var/spool/slurm
- /etc/munge
- /etc/slurm
- name: Install munge_keyfile
copy:
src: files/munge.key
dest: /srv/slurm/volumes/etc/munge/munge.key
- name: install slurm config files
template:
src: files/{{ item }}
dest: /srv/slurm/volumes/etc/slurm
with_items:
- slurm.conf
- slurmdbd.conf
- job_submit.lua
- name: install build files
template:
src: files/{{ item }}
dest: /srv/slurm
with_items:
- Dockerfile
- ldap.conf
- nslcd.conf
- pam_ldap.conf
- runslurmctld.sh
- nsswitch.conf
- ssmtp.conf
- name: force (re)build slurm image
docker_image:
state: present
force: yes
path: /srv/slurm
name: hpc/slurm
nocache: yes
tags:
- build
- name: Install service files.
template:
src: files/{{item}}
dest: /etc/systemd/system/{{item}}
mode: 644
owner: root
group: root
with_items:
- munge.service
- slurmdbd.service
- slurm.service
tags:
- service-files
- name: install service files
command: systemctl daemon-reload
- name: make sure servcies are started.
systemd:
name: "{{item}}"
state: restarted
with_items:
- slurmdbd.service
- munge.service
- slurm.service #slurmctl
tags:
- start-service