From 5bbec79ae9de2a72a825cade292a82c479cee8d0 Mon Sep 17 00:00:00 2001 From: Shim Shtein Date: Tue, 28 Jan 2025 11:05:52 -0500 Subject: [PATCH] Fixes #38168 - Add hostname parameter to kickstart kernel params --- .../snippet/kickstart_kernel_options.erb | 4 ++-- .../PXEGrub/Kickstart_default_PXEGrub.host4and6dhcp.snap.txt | 2 +- .../PXEGrub/Kickstart_default_PXEGrub.host4dhcp.snap.txt | 2 +- .../PXEGrub/Kickstart_default_PXEGrub.host6dhcp.snap.txt | 2 +- .../Kickstart_default_PXEGrub2.host4and6dhcp.snap.txt | 2 +- .../PXEGrub2/Kickstart_default_PXEGrub2.host4dhcp.snap.txt | 2 +- .../PXEGrub2/Kickstart_default_PXEGrub2.host6dhcp.snap.txt | 2 +- .../Kickstart_default_PXELinux.host4and6dhcp.snap.txt | 2 +- .../PXELinux/Kickstart_default_PXELinux.host4dhcp.snap.txt | 2 +- .../PXELinux/Kickstart_default_PXELinux.host6dhcp.snap.txt | 2 +- .../iPXE/Kickstart_default_iPXE.host4and6dhcp.snap.txt | 2 +- .../iPXE/Kickstart_default_iPXE.host4dhcp.snap.txt | 2 +- .../iPXE/Kickstart_default_iPXE.host6dhcp.snap.txt | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/unattended/provisioning_templates/snippet/kickstart_kernel_options.erb b/app/views/unattended/provisioning_templates/snippet/kickstart_kernel_options.erb index ef494e5f694..0e878d93b6e 100644 --- a/app/views/unattended/provisioning_templates/snippet/kickstart_kernel_options.erb +++ b/app/views/unattended/provisioning_templates/snippet/kickstart_kernel_options.erb @@ -67,7 +67,7 @@ description: | end options.push("dualstack!") if subnet4 && subnet6 if subnet4 && subnet4.dhcp_boot_mode? - options.push("ip=dhcp") if rhel_compatible && major >= 7 + options.push("ip=::::#{hostname}::dhcp") if rhel_compatible && major >= 7 elsif subnet4 && !subnet4.dhcp_boot_mode? if rhel_compatible && major < 7 dns_servers = subnet4.dns_servers.join(',') @@ -84,7 +84,7 @@ description: | end end elsif subnet6 && subnet6.dhcp_boot_mode? && rhel_compatible && major >= 7 - options.push("ip=auto6") + options.push("ip=::::#{hostname}::auto6") elsif subnet6 && !subnet6.dhcp_boot_mode? raise("Static IPv6 provisioning works on RHEL7 or newer") if rhel_compatible && major < 7 gw = subnet6.gateway ? "[#{subnet6.gateway}]" : "" diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4and6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4and6dhcp.snap.txt index bd6255c382c..028b126ff14 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4and6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4and6dhcp.snap.txt @@ -5,7 +5,7 @@ timeout=10 title Kickstart default PXEGrub root (nd) - kernel (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 + kernel (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-6-dhcp-el7::dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 initrd (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-initrd.img diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4dhcp.snap.txt index bd6255c382c..3b82a49215e 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host4dhcp.snap.txt @@ -5,7 +5,7 @@ timeout=10 title Kickstart default PXEGrub root (nd) - kernel (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 + kernel (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-dhcp-el7::dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 initrd (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-initrd.img diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host6dhcp.snap.txt index 998ea34c814..af1540de4dc 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub/Kickstart_default_PXEGrub.host6dhcp.snap.txt @@ -5,7 +5,7 @@ timeout=10 title Kickstart default PXEGrub root (nd) - kernel (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=2001:db8:42::8 nameserver=2001:db8:42::4 fips=1 + kernel (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv6-dhcp-el7::dhcp nameserver=2001:db8:42::8 nameserver=2001:db8:42::4 fips=1 initrd (nd)/../boot/centos-mirror-nrm0GtSX1ZC5-initrd.img diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4and6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4and6dhcp.snap.txt index 04b3e9b910e..82cf0160d7a 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4and6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4and6dhcp.snap.txt @@ -4,7 +4,7 @@ set default=0 set timeout=10 menuentry 'Kickstart default PXEGrub2' { - linux boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 + linux boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-6-dhcp-el7::dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 initrd boot/centos-mirror-nrm0GtSX1ZC5-initrd.img } diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4dhcp.snap.txt index 04b3e9b910e..a5cf073c54c 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host4dhcp.snap.txt @@ -4,7 +4,7 @@ set default=0 set timeout=10 menuentry 'Kickstart default PXEGrub2' { - linux boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 + linux boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-dhcp-el7::dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 initrd boot/centos-mirror-nrm0GtSX1ZC5-initrd.img } diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host6dhcp.snap.txt index 9ea129da8d2..b936e101307 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXEGrub2/Kickstart_default_PXEGrub2.host6dhcp.snap.txt @@ -4,7 +4,7 @@ set default=0 set timeout=10 menuentry 'Kickstart default PXEGrub2' { - linux boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=2001:db8:42::8 nameserver=2001:db8:42::4 fips=1 + linux boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv6-dhcp-el7::dhcp nameserver=2001:db8:42::8 nameserver=2001:db8:42::4 fips=1 initrd boot/centos-mirror-nrm0GtSX1ZC5-initrd.img } diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4and6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4and6dhcp.snap.txt index e5c11c5342f..e89f1545d79 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4and6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4and6dhcp.snap.txt @@ -7,7 +7,7 @@ ONTIMEOUT installer LABEL installer MENU LABEL Kickstart default PXELinux KERNEL boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz -APPEND initrd=boot/centos-mirror-nrm0GtSX1ZC5-initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 +APPEND initrd=boot/centos-mirror-nrm0GtSX1ZC5-initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-6-dhcp-el7::dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 IPAPPEND 2 diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4dhcp.snap.txt index e5c11c5342f..ed5fffaf358 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host4dhcp.snap.txt @@ -7,7 +7,7 @@ ONTIMEOUT installer LABEL installer MENU LABEL Kickstart default PXELinux KERNEL boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz -APPEND initrd=boot/centos-mirror-nrm0GtSX1ZC5-initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 +APPEND initrd=boot/centos-mirror-nrm0GtSX1ZC5-initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-dhcp-el7::dhcp nameserver=192.168.42.2 nameserver=192.168.42.3 fips=1 IPAPPEND 2 diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host6dhcp.snap.txt index 3792e17b49a..b77d9dbf9d4 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/PXELinux/Kickstart_default_PXELinux.host6dhcp.snap.txt @@ -7,7 +7,7 @@ ONTIMEOUT installer LABEL installer MENU LABEL Kickstart default PXELinux KERNEL boot/centos-mirror-nrm0GtSX1ZC5-vmlinuz -APPEND initrd=boot/centos-mirror-nrm0GtSX1ZC5-initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp nameserver=2001:db8:42::8 nameserver=2001:db8:42::4 fips=1 +APPEND initrd=boot/centos-mirror-nrm0GtSX1ZC5-initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv6-dhcp-el7::dhcp nameserver=2001:db8:42::8 nameserver=2001:db8:42::4 fips=1 IPAPPEND 2 diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4and6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4and6dhcp.snap.txt index 51030cbbe0e..f7b9d559ee0 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4and6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4and6dhcp.snap.txt @@ -5,7 +5,7 @@ ping --count 1 ${netX/gateway} || echo Ping to Gateway failed or ping command no echo Trying to ping DNS: ${netX/dns} ping --count 1 ${netX/dns} || echo Ping to DNS failed or ping command not available. -kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp fips=1 +kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-6-dhcp-el7::dhcp fips=1 initrd http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/initrd.img imgstat sleep 2 diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4dhcp.snap.txt index 51030cbbe0e..5c14d1af4d4 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host4dhcp.snap.txt @@ -5,7 +5,7 @@ ping --count 1 ${netX/gateway} || echo Ping to Gateway failed or ping command no echo Trying to ping DNS: ${netX/dns} ping --count 1 ${netX/dns} || echo Ping to DNS failed or ping command not available. -kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp fips=1 +kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv4-dhcp-el7::dhcp fips=1 initrd http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/initrd.img imgstat sleep 2 diff --git a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host6dhcp.snap.txt b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host6dhcp.snap.txt index 51030cbbe0e..9fc3873ef96 100644 --- a/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host6dhcp.snap.txt +++ b/test/unit/foreman/renderer/snapshots/ProvisioningTemplate/iPXE/Kickstart_default_iPXE.host6dhcp.snap.txt @@ -5,7 +5,7 @@ ping --count 1 ${netX/gateway} || echo Ping to Gateway failed or ping command no echo Trying to ping DNS: ${netX/dns} ping --count 1 ${netX/dns} || echo Ping to DNS failed or ping command not available. -kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=dhcp fips=1 +kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img network ksdevice=bootif ks.device=bootif BOOTIF=01-00-f0-54-1a-7e-e0 ks=http://foreman.example.com/unattended/provision kssendmac ks.sendmac ip=::::snapshot-ipv6-dhcp-el7::dhcp fips=1 initrd http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/initrd.img imgstat sleep 2