]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #3428: cloudinit: add parameter for upgrade on boot
authorLeo Nunner <l.nunner@proxmox.com>
Thu, 4 May 2023 10:55:01 +0000 (12:55 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 7 Jun 2023 16:25:46 +0000 (18:25 +0200)
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 <l.nunner@proxmox.com>
PVE/QemuServer.pm
PVE/QemuServer/Cloudinit.pm

index 40bd12fcd30bae60a333b21216ade02e9d49e543..8ff63c3c13d6aeb9d99660b32ba33f75fb26a8eb 100644 (file)
@@ -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',
index a0c3d60ca2a10774587e08d55ac6634a6631e639..10962b507820bad81cc437b6e91e772300a45628 100644 (file)
@@ -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;
 }