Skip to content

Commit ceaba17

Browse files
committed
unlock instances before rebuild-via-slurm
1 parent ca47578 commit ceaba17

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
3+
- hosts: "{{ target_hosts | default('all') }}"
4+
gather_facts: no
5+
become: no
6+
tasks:
7+
- name: Lock/Unlock instances
8+
openstack.cloud.server_action:
9+
action: "{{ server_action | default('lock') }}"
10+
server: "{{ inventory_hostname }}"

ansible/adhoc/rebuild-via-slurm.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88

99
# See docs/slurm-controlled-rebuild.md.
1010

11+
- hosts: localhost
12+
gather_facts: false
13+
vars:
14+
server_action: unlock
15+
target_hosts: compute
16+
tasks:
17+
- name: Unlock compute instances for rebuild
18+
ansible.builtin.include_playbook:
19+
file: adhoc/lock_unlock_instances.yml
20+
1121
- hosts: login
1222
run_once: true
1323
gather_facts: false

ansible/site.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
2+
- name: Lock all instances
3+
vars:
4+
server_action: lock
5+
target_hosts: all
6+
ansible.builtin.import_playbook: adhoc/lock_unlock_instances.yml
7+
28
- name: Run pre.yml hook
39
vars:
410
# hostvars not available here, so have to recalculate environment root:

0 commit comments

Comments
 (0)