mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-12 19:44:57 +02:00
docker-vm: add error handling for virt-customize finalize steps
The hostname, machine-id and dbus cleanup calls were missing || true, so when virt-customize fails (e.g. on newer distros) the whole script aborts. The SSH config calls already had || true, these were just missed. Cloud-Init will set the hostname on first boot anyway. Ref #12073
This commit is contained in:
@@ -525,9 +525,9 @@ fi
|
||||
|
||||
msg_info "Finalizing image (hostname, SSH config)"
|
||||
# Set hostname and prepare for unique machine-id
|
||||
virt-customize -q -a "$WORK_FILE" --hostname "${HN}" >/dev/null 2>&1
|
||||
virt-customize -q -a "$WORK_FILE" --run-command "truncate -s 0 /etc/machine-id" >/dev/null 2>&1
|
||||
virt-customize -q -a "$WORK_FILE" --run-command "rm -f /var/lib/dbus/machine-id" >/dev/null 2>&1
|
||||
virt-customize -q -a "$WORK_FILE" --hostname "${HN}" >/dev/null 2>&1 || true
|
||||
virt-customize -q -a "$WORK_FILE" --run-command "truncate -s 0 /etc/machine-id" >/dev/null 2>&1 || true
|
||||
virt-customize -q -a "$WORK_FILE" --run-command "rm -f /var/lib/dbus/machine-id" >/dev/null 2>&1 || true
|
||||
|
||||
# Configure SSH for Cloud-Init
|
||||
if [ "$USE_CLOUD_INIT" = "yes" ]; then
|
||||
|
||||
Reference in New Issue
Block a user