-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook-task-sync-nodes.yml
79 lines (69 loc) · 2.29 KB
/
playbook-task-sync-nodes.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
- name: Sync nodes
hosts: "mgmt.{{domain}}"
become: true
tasks:
- name: Remove dummy slurm partition
ansible.builtin.lineinfile:
path: /etc/slurm/slurm.conf
regexp: "^PartitionName=dummy"
firstmatch: yes
line: ""
- name: Remove broken SlurmctldParameters
ansible.builtin.lineinfile:
path: /etc/slurm/slurm.conf
regexp: "^SlurmctldParameters="
firstmatch: yes
line: ""
- name: Update slurm gres config
ansible.builtin.blockinfile:
path: /etc/slurm/gres.conf
block: |
AutoDetect=nvml
AutoDetect=rsmi
AutoDetect=nrt
AutoDetect=oneapi
- name: Update slurm stateless partition and node definitions
ansible.builtin.blockinfile:
path: /etc/slurm/slurm.conf
append_newline: true
prepend_newline: true
marker: "### {mark} Ansible generated block: do not edit this section! ###"
# XXX Re-add SlurmctldParameters and ReturnToService due to malformed template, see https://github.com/stackhpc/ansible-role-openhpc/issues/170
block: |
SchedulerParameters=sched_interval=1
SlurmctldParameters=enable_configless
PrologFlags=Alloc
PriorityCalcPeriod=1
ReturnToService=2
MaxNodeCount=65536
SrunPortRange={{srun_port_range}}
GresTypes=gpu
{{ lookup('ansible.builtin.template', './slurm.nodes.conf.j2') }}
- name: Restart slurmctld
ansible.builtin.systemd_service:
name: slurmctld
state: restarted
enabled: true
- name: Setup warewulf node config
template:
src: nodes.conf.j2
dest: /etc/warewulf/nodes.conf
- name: Configure warewulf
ansible.builtin.shell: |
wwctl overlay build
wwctl configure --all
- name: Restart warewulfd
ansible.builtin.systemd_service:
name: warewulfd
state: restarted
enabled: true
- name: Sync mgmt reservations
hosts: "router.{{domain}}"
become: true
tasks:
- name: Upload ISC DHCP reservations
template:
src: mgmt-reservation.conf.j2
dest: /usr/local/etc/dhcpd.opnsense.d/mgmt-reservation.conf
- name: Restart ISC DHCP service
shell: pluginctl -s dhcpd restart