Skip to content

Commit ed1bfa5

Browse files
committed
add rebuild role to appliance and modify groupvars
1 parent 40665c0 commit ed1bfa5

File tree

9 files changed

+53
-42
lines changed

9 files changed

+53
-42
lines changed

ansible/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,5 @@ roles/*
8080
!roles/slurm_stats/**
8181
!roles/pytools/
8282
!roles/pytools/**
83+
!roles/rebuild/
84+
!roles/rebuild/**
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
openhpc_rebuild_clouds: ~/.config/openstack/clouds.yaml

ansible/roles/rebuild/tasks/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
3+
- name: Create /etc/openstack
4+
file:
5+
path: /etc/openstack
6+
state: directory
7+
owner: root
8+
group: root
9+
mode: '0400'
10+
11+
- name: Copy out clouds.yaml
12+
copy:
13+
src: "{{ openhpc_rebuild_clouds }}"
14+
dest: /etc/openstack/clouds.yaml
15+
owner: root
16+
group: root
17+
mode: '0400'
18+
19+
- name: Setup slurm tools
20+
include_role:
21+
name: slurm_tools

ansible/roles/slurm_tools/.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

ansible/slurm.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
- include_role:
1010
name: mysql
1111

12+
- name: Setup slurm-driven rebuild
13+
hosts: rebuild
14+
become: yes
15+
tags:
16+
- rebuild
17+
tasks:
18+
- import_role:
19+
name: rebuild
20+
1221
- name: Setup slurm
1322
hosts: openhpc
1423
become: yes

environments/.stackhpc/inventory/extra_groups

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
[basic_users:children]
22
cluster
33

4-
[rebuild:children]
5-
control
6-
compute
7-
84
[etc_hosts:children]
95
cluster
106

@@ -35,3 +31,6 @@ builder
3531
[sssd:children]
3632
# Install sssd into fat image
3733
builder
34+
35+
[rebuild:children]
36+
control

environments/common/inventory/group_vars/all/openhpc.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ openhpc_packages_extra: []
3131
openhpc_packages: "{{ openhpc_packages_default + openhpc_packages_extra }}"
3232
openhpc_munge_key: "{{ vault_openhpc_mungekey | b64decode }}"
3333
openhpc_login_only_nodes: login
34-
openhpc_config_default:
35-
SlurmctldParameters:
36-
- enable_configless
37-
TaskPlugin: task/cgroup,task/affinity
34+
openhpc_config_default: >-
35+
{{
36+
{
37+
'SlurmctldParameters': ['enable_configless'] +
38+
(['reboot_from_controller'] if groups['rebuild'] | length > 0 else []),
39+
'TaskPlugin': 'task/cgroup,task/affinity'
40+
}
41+
| combine(
42+
{'RebootProgram': '/opt/slurm-tools/bin/slurm-openstack-rebuild'} if groups['rebuild'] | length > 0 else {}
43+
)
44+
}}
3845
openhpc_config_extra: {}
3946
openhpc_config: "{{ openhpc_config_default | combine(openhpc_config_extra, list_merge='append') }}"
4047
openhpc_state_save_location: "{{ appliances_state_dir + '/slurmctld' if appliances_state_dir is defined else '/var/spool' }}"

environments/common/inventory/groups

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ mysql
6262
# All hosts requiring control of SELinux status.
6363
cluster
6464

65-
[rebuild]
66-
# Enable rebuild of nodes on an OpenStack cloud; add 'control' group plus 'compute' group or a subset of it.
67-
6865
[update]
6966
# All hosts to (optionally) run yum update on.
7067

@@ -165,3 +162,6 @@ extra_packages
165162

166163
[pulp]
167164
# Add builder to this group to enable automatically syncing of pulp during image build
165+
166+
[rebuild]
167+
# Enable rebuild of nodes on an OpenStack cloud; add 'control' group plus 'compute' group or a subset of it.

environments/common/layouts/everything

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ control
2525
[filebeat:children]
2626
slurm_stats
2727

28-
# NB: [rebuild] not defined here as this template is used in CI
29-
3028
[update:children]
3129

3230
[fail2ban:children]
@@ -111,3 +109,5 @@ control
111109
[extra_packages:children]
112110
# Hosts to install specified additional packages on
113111
builder
112+
113+
# NB: [rebuild] not defined here as this template is used in CI

0 commit comments

Comments
 (0)