From efa3355d3b17170e073258331bfa9e2b99f3fa43 Mon Sep 17 00:00:00 2001 From: Leo Nunner Date: Thu, 4 May 2023 12:55:01 +0200 Subject: [PATCH] fix #3428: cloudinit: add parameter for upgrade on boot up until now, we did an automatic upgrade after the first boot in our standard cloud-init config. This has been requested to be toggleable several times [1][2]. With this patch, "package_upgrade" is disabled by default, and needs to be enabled manually, diverging from the previous behaviour. [1] https://forum.proxmox.com/threads/how-to-prevent-automatic-apt-upgrade-during-the-first-boot-with-cloud-init.68472/ [2] https://forum.proxmox.com/threads/cloud-init-ohne-package-upgrade.123841/ Signed-off-by: Leo Nunner --- PVE/QemuServer.pm | 5 +++++ PVE/QemuServer/Cloudinit.pm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 40bd12f..8ff63c3 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -780,6 +780,11 @@ my $confdesc_cloudinit = { .' recommended. Use ssh keys instead. Also note that older cloud-init versions do not' .' support hashed passwords.', }, + ciupgrade => { + optional => 1, + type => 'boolean', + description => 'cloud-init: do an automatic package upgrade after the first boot.' + }, cicustom => { optional => 1, type => 'string', diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm index a0c3d60..10962b5 100644 --- a/PVE/QemuServer/Cloudinit.pm +++ b/PVE/QemuServer/Cloudinit.pm @@ -146,7 +146,7 @@ sub cloudinit_userdata { $content .= " - default\n"; } - $content .= "package_upgrade: true\n"; + $content .= "package_upgrade: true\n" if $conf->{ciupgrade}; return $content; } -- 2.39.2