public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] base_image: move size adjustment until after we verify checksums
@ 2025-08-23 21:24 Luis Chamberlain
  2025-08-25 11:49 ` Daniel Gomez
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Chamberlain @ 2025-08-23 21:24 UTC (permalink / raw)
  To: Chuck Lever, Daniel Gomez, kdevops; +Cc: Luis Chamberlain

Move the sha512 checksum check to run *after* we resize the image.
Otherwise we fail.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 .../roles/base_image/tasks/custom-image.yml   | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/playbooks/roles/base_image/tasks/custom-image.yml b/playbooks/roles/base_image/tasks/custom-image.yml
index 46701e759adf..a30c8c96a31f 100644
--- a/playbooks/roles/base_image/tasks/custom-image.yml
+++ b/playbooks/roles/base_image/tasks/custom-image.yml
@@ -46,16 +46,6 @@
     - not custom_image_stat.stat.exists
     - guestfs_has_custom_raw_image_url|bool
 
-- name: Resize custom image to match configured size
-  become: true
-  become_method: ansible.builtin.sudo
-  ansible.builtin.command:
-    cmd: "qemu-img resize {{ custom_image }} {{ libvirt_image_size }}"
-  changed_when: true
-  when:
-    - custom_image_download is changed or custom_image_stat.stat.exists
-    - guestfs_has_custom_raw_image_url|bool
-
 - name: Check if the custom image sentinel file already exists
   ansible.builtin.stat:
     path: "{{ custom_image_ok }}"
@@ -124,6 +114,15 @@
         - not sentinel_stat.stat.exists
         - id_output.rc != 0
 
+    - name: Resize custom image to match configured size
+      become: true
+      become_method: ansible.builtin.sudo
+      ansible.builtin.command:
+        cmd: "qemu-img resize -f raw {{ custom_image }} {{ libvirt_image_size }}"
+      changed_when: true
+      when:
+        - not sentinel_stat.stat.exists
+
     - name: Create a temporary file for virt-customize commands
       ansible.builtin.tempfile:
         state: file
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-25 11:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-23 21:24 [PATCH] base_image: move size adjustment until after we verify checksums Luis Chamberlain
2025-08-25 11:49 ` Daniel Gomez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox