Skip to content

Commit fae22a4

Browse files
committed
CI: Move "make clean" into cleanup phase
This will allow to debug a broken installation via a held node. Signed-off-by: Dr. Jens Harbott <[email protected]>
1 parent ba92af8 commit fae22a4

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

.zuul.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
nodeset: testbed-orchestrator
3535
run: playbooks/deploy.yml
3636
post-run: playbooks/post.yml
37+
cleanup-run: playbooks/cleanup.yml
3738
required-projects:
3839
- osism/ansible-collection-commons
3940
- osism/ansible-collection-services

playbooks/cleanup.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
- name: Cleanup play
3+
hosts: all
4+
5+
vars_files:
6+
- vars/cloud_envs.yml
7+
8+
tasks:
9+
- name: Set cloud_env fact (Zuul deployment)
10+
ansible.builtin.set_fact:
11+
cloud_env: "{{ cloud_envs[hostvars[groups['all'][0]]['nodepool']['label']] }}"
12+
when: "'nodepool' in hostvars[groups['all'][0]]"
13+
14+
- name: Set cloud_env fact (local deployment)
15+
ansible.builtin.set_fact:
16+
cloud_env: "{{ testbed_environment | default('ci') }}"
17+
when: "'nodepool' not in hostvars[groups['all'][0]]"
18+
19+
- name: Make clean
20+
ansible.builtin.shell:
21+
chdir: "{{ ansible_user_dir }}/src/github.com/osism/testbed/terraform"
22+
cmd: make ENVIRONMENT={{ cloud_env }} clean 2>&1

playbooks/post.yml

-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
---
2-
- name: Post clean play
3-
hosts: all
4-
5-
vars_files:
6-
- vars/cloud_envs.yml
7-
8-
tasks:
9-
- name: Set cloud_env fact (Zuul deployment)
10-
ansible.builtin.set_fact:
11-
cloud_env: "{{ cloud_envs[hostvars[groups['all'][0]]['nodepool']['label']] }}"
12-
when: "'nodepool' in hostvars[groups['all'][0]]"
13-
14-
- name: Set cloud_env fact (local deployment)
15-
ansible.builtin.set_fact:
16-
cloud_env: "{{ testbed_environment | default('ci') }}"
17-
when: "'nodepool' not in hostvars[groups['all'][0]]"
18-
19-
- name: Make clean
20-
ansible.builtin.shell:
21-
chdir: "{{ ansible_user_dir }}/src/github.com/osism/testbed/terraform"
22-
cmd: make ENVIRONMENT={{ cloud_env }} clean 2>&1
23-
242
- name: Post output play
253
hosts: all
264

0 commit comments

Comments
 (0)