Skip to content

Commit 4a1192c

Browse files
committed
[reproducer] Fix PreMetal handling of extra_variable_files
PreMetal provisions hosts from the main branch, generating reproducer-variables.yml with base scenario vars. During the actual Zuul job, overwrite_zuul_vars.yml only merges zuul_vars.yaml into reproducer-variables.yml, ignoring extra_variable_files entirely. Additionally, the slurp + copy-content pattern for transferring reproducer-variables.yml triggers Jinja2 evaluation on the file content, breaking when the bootstrap bakes raw templates into nested structures. Pass extra_variable_files as -e @<file> args to the deployment scripts, and replace slurp + copy-content with fetch + copy-src to transfer files as raw bytes without template evaluation.
1 parent 21dbd39 commit 4a1192c

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

roles/reproducer/tasks/overwrite_zuul_vars.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,12 @@
1919
temp_reproducer_var_path: /tmp/reproducer-variables.yml
2020
temp_merged_reproducer_var_path: /tmp/merged-reproducer-variables.yml
2121
block:
22-
- name: Slurp reproducer-variables.yml to hypervisor
23-
ansible.builtin.slurp:
22+
- name: Fetch reproducer-variables.yml from controller-0
23+
ansible.builtin.fetch:
2424
src: "{{ cifmw_basedir }}/parameters/reproducer-variables.yml"
25-
register: reproducer_original
26-
delegate_to: controller-0
27-
no_log: "{{ cifmw_nolog | default(true) | bool }}"
28-
29-
- name: Create temp file reproducer-variables.yml on hypervisor
30-
ansible.builtin.copy:
31-
content: "{{ reproducer_original.content | b64decode }}"
3225
dest: "{{ temp_reproducer_var_path }}"
33-
mode: "0664"
26+
flat: true
27+
delegate_to: controller-0
3428
no_log: "{{ cifmw_nolog | default(true) | bool }}"
3529

3630
- name: Copy merge yamls script
@@ -48,15 +42,9 @@
4842
{{ temp_merged_reproducer_var_path }}
4943
no_log: "{{ cifmw_nolog | default(true) | bool }}"
5044

51-
- name: Slurp merged reproducer-variables.yml from hypervisor
52-
ansible.builtin.slurp:
53-
src: "{{ temp_merged_reproducer_var_path }}"
54-
register: merged_reproducer_slurp
55-
no_log: "{{ cifmw_nolog | default(true) | bool }}"
56-
5745
- name: Write back merged reproducer-variables.yml
5846
ansible.builtin.copy:
59-
content: "{{ merged_reproducer_slurp.content | b64decode }}"
47+
src: "{{ temp_merged_reproducer_var_path }}"
6048
dest: "{{ cifmw_basedir }}/parameters/reproducer-variables.yml"
6149
mode: "0664"
6250
backup: true
@@ -65,7 +53,7 @@
6553

6654
- name: Overwrite custom-params.yml
6755
ansible.builtin.copy:
68-
content: "{{ merged_reproducer_slurp.content | b64decode }}"
56+
src: "{{ temp_merged_reproducer_var_path }}"
6957
dest: "{{ cifmw_basedir }}/artifacts/parameters/custom-params.yml"
7058
mode: "0664"
7159
no_log: "{{ cifmw_nolog | default(true) | bool }}"

roles/reproducer/tasks/premetal.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
loop_control:
3131
loop_var: secret_file
3232

33+
- name: Pass extra variable files to deployment scripts
34+
ansible.builtin.set_fact:
35+
cifmw_deploy_architecture_args: >
36+
{{ cifmw_deploy_architecture_args | default('') }}
37+
-e @{{ extra_variable_file }}
38+
cifmw_post_deploy_args: >
39+
{{ cifmw_post_deploy_args | default('') }}
40+
-e @{{ extra_variable_file }}
41+
loop: "{{ extra_variable_files | default([]) }}"
42+
loop_control:
43+
loop_var: extra_variable_file
44+
3345
- name: Print final cifmw_deploy_architecture_args
3446
ansible.builtin.debug:
3547
msg: >

0 commit comments

Comments
 (0)