Skip to content

Commit b02a309

Browse files
committed
guestfs: fix custom image bringup failure for Debian 13
When using custom images (like Debian 13 daily builds), the base_image role would incorrectly attempt to build the image using virt-builder even though a custom image workflow was configured. This failed because "debian-13-generic-amd64-daily" is not a valid virt-builder template. The issue had two root causes: 1. The base-image.yml task would run even when custom images were configured, attempting to use virt-builder with an invalid template 2. The custom-image.yml task prepared the custom image but never copied it to the base_image_pathname location expected by subsequent tasks Fix both issues by: - Adding a condition to skip base-image.yml when using custom images - Copying the prepared custom image to the base_image_pathname location This ensures custom images are properly downloaded, prepared with the kdevops user configuration, and placed in the expected location for VM provisioning. Fixes: df31e8f55d7d ("guestfs: fix custom image partition not expanded after disk resize") Generated-by: Claude AI Signed-off-by: Luis Chamberlain <[email protected]>
1 parent dea3962 commit b02a309

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

playbooks/roles/base_image/tasks/custom-image.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,14 @@
281281
- "--no-compression"
282282
- "{{ custom_image_dir }}"
283283
changed_when: true
284+
285+
- name: Copy custom image to base image location
286+
become: true
287+
become_method: ansible.builtin.sudo
288+
ansible.builtin.copy:
289+
src: "{{ custom_image }}"
290+
dest: "{{ base_image_pathname }}"
291+
remote_src: true
292+
mode: "u=rw,g=r,o=r"
293+
when:
294+
- custom_image_stat.stat.exists or custom_image_download is changed

playbooks/roles/base_image/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
file: "{{ role_path }}/tasks/base-image.yml"
1818
when:
1919
- not result.stat.exists
20+
- not guestfs_has_custom_raw_image|bool

0 commit comments

Comments
 (0)