From d44bcef4e6bf6cf33d59b1a6b4f554dc5b63f384 Mon Sep 17 00:00:00 2001
From: Michael Prokop <mprokop@sipwise.com>
Date: Fri, 18 Nov 2022 12:29:43 +0100
Subject: [PATCH] MT#55988 Update kernel command line for installing Debian
 w/wo puppet

The public name servers resolve deb.sipwise.com to our public OVH IP
address 164.132.119.186, while internally we want to use its cname
haproxy.mgm.sipwise.com. This only works with using our internal
nameservers (like 192.168.212.30 and 192.168.88.20).

Default to 192.168.212.30, so deployments work as expected, otherwise
we're failing during deployment with:

| Err:5 https://deb.sipwise.com/autobuild release-trunk-bookworm InRelease
|  403  Forbidden [IP: 164.132.119.186 443]

While at it also update the ip=... kernel option, to use
168.192.91.XX/24 by default, and also use a FQDN for the hostname (since
that's our current policy for puppet hostname/certificates).

Change-Id: I1ce6541f7a31baa437e679b67056bb7851b1b33d
---
 grub.cfg     | 4 ++--
 isolinux.cfg | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/grub.cfg b/grub.cfg
index a2826be..b184474 100644
--- a/grub.cfg
+++ b/grub.cfg
@@ -50,7 +50,7 @@ menuentry "Install Debian/buster 64bit" {
 
 menuentry "Install Debian/buster 64bit - Puppet" {
   echo 'Loading kernel...'
-  linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=buster scripts puppetenv=production dns=1.1.1.1,1.0.0.1 ip=10.15.20.123::10.15.20.1:255.255.255.0:puppet-client42:eth0:off 
+  linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=buster scripts puppetenv=production dns=192.168.212.30 ip=192.168.91.XX::192.168.91.1:255.255.255.0:puppet-client42.mgm.sipwise.com:eth0:off 
   echo 'Loading initrd...'
   initrd /boot/%SHORT_NAME%/initrd.img
 }
@@ -64,7 +64,7 @@ menuentry "Install Debian/bullseye 64bit" {
 
 menuentry "Install Debian/bullseye 64bit - Puppet" {
   echo 'Loading kernel...'
-  linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=bullseye scripts puppetenv=production dns=1.1.1.1,1.0.0.1 ip=10.15.20.123::10.15.20.1:255.255.255.0:puppet-client42:eth0:off 
+  linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=bullseye scripts puppetenv=production dns=192.168.212.30 ip=192.168.91.XX::192.168.91.1:255.255.255.0:puppet-client42.mgm.sipwise.com:eth0:off 
   echo 'Loading initrd...'
   initrd /boot/%SHORT_NAME%/initrd.img
 }
diff --git a/isolinux.cfg b/isolinux.cfg
index c700ddf..bc45ad5 100644
--- a/isolinux.cfg
+++ b/isolinux.cfg
@@ -122,7 +122,7 @@ label buster
 label busterpuppet
   menu label Install Debian/buster  64bit - Puppet
   kernel /boot/%SHORT_NAME%/vmlinuz
-  append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=buster scripts puppetenv=production dns=1.1.1.1,1.0.0.1 ip=10.15.20.123::10.15.20.1:255.255.255.0:puppet-client42:eth0:off 
+  append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=buster scripts puppetenv=production dns=192.168.212.30 ip=192.168.91.XX::192.168.91.1:255.255.255.0:puppet-client42.mgm.sipwise.com:eth0:off 
 
   text help
                                      Install Debian buster, 64bit using
@@ -147,7 +147,7 @@ label bullseye
 label bullseyepuppet
   menu label Install Debian/bullseye  64bit - Puppet
   kernel /boot/%SHORT_NAME%/vmlinuz
-  append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=bullseye scripts puppetenv=production dns=1.1.1.1,1.0.0.1 ip=10.15.20.123::10.15.20.1:255.255.255.0:puppet-client42:eth0:off 
+  append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off mgag200.modeset=0 vga=791 quiet nomce net.ifnames=0 nongcp ssh=sipwise debianrelease=bullseye scripts puppetenv=production dns=192.168.212.30 ip=192.168.91.XX::192.168.91.1:255.255.255.0:puppet-client42.mgm.sipwise.com:eth0:off 
 
   text help
                                      Install Debian bullseye, 64bit using