-
Notifications
You must be signed in to change notification settings - Fork 0
/
pi_compute_node_setup.yml
96 lines (79 loc) · 3.27 KB
/
pi_compute_node_setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# ARIZONA STATE UNIVERSITY RESEARCH COMPUTING PI CLUSTER v1.0
#
# .~~. .~~.
# '. \ ' ' / .'
# .~ .~~~..~. _ _
# : .~.'~'.~. : ___ ___ ___ ___| |_ ___ ___ ___ _ _ ___|_|
# ~ ( ) ( ) ~ | _| .'|_ -| . | . | -_| _| _| | | | . | |
# ( : '~'.~.'~' : ) |_| |__,|___| _|___|___|_| |_| |_ | | _|_|
# ~ .~ ( ) ~. ~ |_| |___| |_|
# ( : '~' : ) ___ _ _ _ ___ _____ ___ ___
# '~ .~~~. ~' | __| |_| | |_ -|_ _| -_| -_|
# '~' |___|___|___|___| |_| |___|_|_|
#
---
- hosts: pi_nodes
user: pi
become: yes
############## INSTALLS ####################
tasks:
- name: Update and upgrade apt packages
apt:
name: "{{ item }}"
update_cache: yes
state: present
with_items:
- nfs-common
- slurmd
- slurm-client
############################################
################ HOSTS #####################
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_login_ip}} {{pi_login_name}}"
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_node01_ip}} {{pi_node01_name}}"
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_node02_ip}} {{pi_node02_name}}"
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_node03_ip}} {{pi_node03_name}}"
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_node04_ip}} {{pi_node04_name}}"
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_node05_ip}} {{pi_node05_name}}"
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_node06_ip}} {{pi_node06_name}}"
- name: check host file for correct hosts
lineinfile: dest=/etc/hosts line="{{pi_node07_ip}} {{pi_node07_name}}"
############################################
########### STORAGE ########################
- name: make sure scratch exists
file:
path: /scratch
state: directory
- name: make sure packages exists
file:
path: /packages
state: directory
- name: mount scratch
lineinfile: dest=/etc/fstab line="{{pi_login_name}}:/scratch /scratch nfs defaults 0 0"
- name: mount packages
lineinfile: dest=/etc/fstab line="{{pi_login_name}}:/packages /packages nfs defaults 0 0"
- name: mount all
command: mount -a
- name: copy files
command: sudo cp /scratch/munge.key /etc/munge/munge.key
- name: copy slurm file over
command: sudo cp /scratch/slurm.conf /etc/slurm-llnl/slurm.conf
- name: copy slurm files over
command: sudo cp /scratch/cgroup.conf /etc/slurm-llnl/cgroup.conf
- name: copy slurm files over
command: sudo cp /scratch/cgroup_allowed_devices_file.conf /etc/slurm-llnl/cgroup_allowed_devices_file.conf
############################################
- name: enable munge
command: systemctl enable munge
- name: start munge
command: systemctl restart munge
- name: enable slurmd
command: systemctl enable slurmd
- name: restart slurmd
command: systemctl restart slurmd