From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5144F163 for ; Sat, 23 Aug 2025 21:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755984268; cv=none; b=d8NriKHmrtYR6dw+eUpQHEIB72P4EAX5oQLIdrsnDRCMcSNDdcuem8ugEhKjnsMQatvTtZTZmU5kPCEfj/7+MFTtxcZBOVKvOPvHd3wtjTsRPQXeHe1w2meQO0riwT9s1O3wydQNN4S1qDI8qjGZ+cz0/R4pLoY/EPdWk3tskY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755984268; c=relaxed/simple; bh=/yAhxbmKnHgd5IH6a3hJE4K+fEo0wMf8qubN5qfJ2cY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dQ3g++9K4xUBIcLjvM7hIix/LSKBTs5yz7cbeA5HMMdeVTOgdQMPt+VaFPnVUZpcRsf9JGgL46tX311jpH2kBxOTckVgqmcxDLwiHUFrFb3CXfynxV7GYtVbFhfZEIlP3iwDFLHK/QlM7qMK3Ci8rHX8EnM1LDgWWluQhEut3XI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=O4oAszMq; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="O4oAszMq" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=rXPvyrHPhvChx3DZoZ4kvzeMiiqzt913+unxtunvCw4=; b=O4oAszMqXBJXUdQ33qdwDdTaU5 ghkRaJZb/bk08BELkkgLt90X24291FWuNe2WKNqDl/vhJvpNF4wcj1TbXbT1ufTxBD6fiq32EXg9l T8RWuyV1n4J2nmO5LajsB+NnTV9TGfn7zj1nujflTjUkzLhFv/nLdeY2RtIhD2RvNS1nSbcb3xzJC zgs9+Vm8usAO+rH93jk8QJrLNzK21XjbqIdVDx65Y0XOPYJW0jN9zQtNx86MrNIt/9Wjp37/65AA+ jYMYoi5IHyFrwkP+5dYvDu0tM6O83Ff1ybsdQsEFkXhzUmI7+brWTxTtR5HIQDsYOj6dVRsNlrweW OFO8NjUQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1upviq-00000005Ifx-3ACy; Sat, 23 Aug 2025 21:24:24 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH] base_image: move size adjustment until after we verify checksums Date: Sat, 23 Aug 2025 14:24:24 -0700 Message-ID: <20250823212424.1263426-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain Move the sha512 checksum check to run *after* we resize the image. Otherwise we fail. Signed-off-by: Luis Chamberlain --- .../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