Faidon Liambotis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/215923

Change subject: autoinstall: workaround silly d-i/tasksel bug
......................................................................

autoinstall: workaround silly d-i/tasksel bug

It turns out that our preseeded value for tasksel/first (of none) was
being ignored, in turn resulting in the default set of tasks to be
installed in at least Debian systems. Moreover, due to the fact that
tasksel defaults to installing a desktop(!) task on systems where
dmidecode does not return a "rack mount chassis", this resulted into
newly-installed VMs to be provisioned with a full GNOME desktop(!).

The cause for this is a bug in d-i, and specifically in the pkgsel
component. pkgsel is responsible for running tasksel, among other
things, and it does so in the target system. Before doing so, it copies
debconf keys from the d-i debconf database to the target system's
debconf database. However, it only copies a very specific set of
filtered keys (language, country, keymap, username) that does not
include tasksel keys. In other words, tasksel runs on the target system
with no tasksel/* values pre-set at all, despite the package having
explicit support for preseeded installations (tasksel/first and
associated comments in tasksel.pl/tasksel-debconf).

Fix this by exploiting pkgsel's pre-hook mechanism and adding a
debconf-copydb from d-i to target, specifically for tasksel keys.

Change-Id: Ib374d4a7d74135e49cd17affe09c391f57defd81
---
M modules/install-server/files/autoinstall/scripts/early_command
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/23/215923/1

diff --git a/modules/install-server/files/autoinstall/scripts/early_command 
b/modules/install-server/files/autoinstall/scripts/early_command
index 24dee97..6ecad68 100644
--- a/modules/install-server/files/autoinstall/scripts/early_command
+++ b/modules/install-server/files/autoinstall/scripts/early_command
@@ -28,6 +28,15 @@
 # which is useful for debugging (see also network-console settings)
 anna-install network-console
 
+# workaround silly d-i bug that makes it ignore the preseeded value of
+# tasksel/first, which in turn resulted in the default tasks being installed.
+cat > /usr/lib/pre-pkgsel.d/20tasksel-debconf <<EOF
+#!/bin/sh
+debconf-copydb -p "^tasksel/" configdb target_configdb
+EOF
+chmod +x /usr/lib/pre-pkgsel.d/20tasksel-debconf
+
+## set up apt
 # preseed the correct wikimedia repository location
 if [ -f /usr/share/keyrings/ubuntu-archive-keyring.gpg ]; then
        SUITE=$(debconf-get mirror/suite)-wikimedia

-- 
To view, visit https://gerrit.wikimedia.org/r/215923
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib374d4a7d74135e49cd17affe09c391f57defd81
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to