all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Leo Nunner <l.nunner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot
Date: Thu,  4 May 2023 12:55:01 +0200	[thread overview]
Message-ID: <20230504105502.108104-2-l.nunner@proxmox.com> (raw)
In-Reply-To: <20230504105502.108104-1-l.nunner@proxmox.com>

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           | 5 +++++
 PVE/QemuServer/Cloudinit.pm | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c1d0fd2..3317fc4 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.30.2





  reply	other threads:[~2023-05-04 10:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 10:55 [pve-devel] [PATCH qemu-server manager] cloudinit: make automatic upgrades toggleable Leo Nunner
2023-05-04 10:55 ` Leo Nunner [this message]
2023-06-07 16:27   ` [pve-devel] applied: [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot Thomas Lamprecht
2023-05-04 10:55 ` [pve-devel] [PATCH manager] fix #3428: cloud-init: add toggle for automatic upgrades Leo Nunner
2023-06-07 16:27   ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230504105502.108104-2-l.nunner@proxmox.com \
    --to=l.nunner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal