Skip to content

Commit b1b7445

Browse files
committed
[reproducer] Move tasks related to pre action after PreMetal bootstrap
Let's move all the tasks for pre job execution after PreMetal bootstrap. That would make reproducer playbook easier to read. Signed-off-by: Daniel Pawlik <dpawlik@redhat.com>
1 parent 6b47997 commit b1b7445

2 files changed

Lines changed: 38 additions & 43 deletions

File tree

reproducer.yml

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -118,53 +118,12 @@
118118
ansible.builtin.set_fact:
119119
hypervisor: "{{ ansible_fqdn }}"
120120

121-
- name: Synchronize src dir
121+
- name: Prepare job after earlier bootstrap by PreMetal
122122
when:
123123
- not cifmw_deploy_reproducer_env | default(true) | bool
124124
ansible.builtin.include_role:
125125
name: reproducer
126-
tasks_from: sync_src_dir.yml
127-
128-
# NOTE(dpawlik): After calling reproducer role using ZIronic tool,
129-
# when the bootstrap phase has been completed, it generates a file
130-
# "reproducer-variables.yml" that contains all variables done in the
131-
# CI job. The problem here is, that "testing" phase might have other
132-
# variables than what was in the bootstrap phase. It means, that
133-
# we need to overwrite the variables with current CI job vars.
134-
- name: Overwrite reproducer-variables.yml when ZIronic bootstrap
135-
when:
136-
- not cifmw_deploy_reproducer_env | default(true) | bool
137-
ansible.builtin.include_role:
138-
name: reproducer
139-
tasks_from: overwrite_zuul_vars.yml
140-
141-
- name: Overwrite pull-secret.json and add missing registries
142-
when:
143-
- not cifmw_deploy_reproducer_env | default(true) | bool
144-
ansible.builtin.include_role:
145-
name: reproducer
146-
tasks_from: overwrite_pull_secret.yml
147-
148-
# NOTE(dpawlik): Since we use ZIronic, some variables are not
149-
# redirected to nested ansible execution - they needs to be
150-
# included on executing host - controller-0.
151-
- name: Compute additional deploy_architecture_args with secrets
152-
when:
153-
- not cifmw_deploy_reproducer_env | default(true) | bool
154-
vars:
155-
basic_secret_files:
156-
- "{{ ansible_user_dir }}/secrets/registry_token_creds.yaml"
157-
ansible.builtin.include_role:
158-
name: reproducer
159-
tasks_from: compute_additional_args.yml
160-
loop: "{{ cifmw_deploy_architecture_secret_files | default(basic_secret_files) }}"
161-
loop_control:
162-
loop_var: secret_file
163-
164-
- name: Print final cifmw_deploy_architecture_args
165-
ansible.builtin.debug:
166-
msg: >
167-
Current cifmw_deploy_architecture_args {{ cifmw_deploy_architecture_args | default('') }}
126+
tasks_from: premetal.yml
168127

169128
- name: Run deployment if instructed to
170129
when:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
- name: Synchronize src dir
3+
ansible.builtin.include_tasks:
4+
file: sync_src_dir.yml
5+
6+
# NOTE(dpawlik): After calling reproducer role using PreMetal tool,
7+
# when the bootstrap phase has been completed, it generates a file
8+
# "reproducer-variables.yml" that contains all variables done in the
9+
# CI job. The problem here is, that "testing" phase might have other
10+
# variables than what was in the bootstrap phase. It means, that
11+
# we need to overwrite the variables with current CI job vars.
12+
- name: Overwrite reproducer-variables.yml when PreMetal bootstrap
13+
ansible.builtin.include_tasks:
14+
file: overwrite_zuul_vars.yml
15+
16+
- name: Overwrite pull-secret.json and add missing registries
17+
ansible.builtin.include_tasks:
18+
file: overwrite_pull_secret.yml
19+
20+
# NOTE(dpawlik): Since we use PreMetal, some variables are not
21+
# redirected to nested ansible execution - they needs to be
22+
# included on executing host - controller-0.
23+
- name: Compute additional deploy_architecture_args with secrets
24+
vars:
25+
basic_secret_files:
26+
- "{{ ansible_user_dir }}/secrets/registry_token_creds.yaml"
27+
ansible.builtin.include_tasks:
28+
file: compute_additional_args.yml
29+
loop: "{{ cifmw_deploy_architecture_secret_files | default(basic_secret_files) }}"
30+
loop_control:
31+
loop_var: secret_file
32+
33+
- name: Print final cifmw_deploy_architecture_args
34+
ansible.builtin.debug:
35+
msg: >
36+
Current cifmw_deploy_architecture_args {{ cifmw_deploy_architecture_args | default('') }}

0 commit comments

Comments
 (0)