I am trying to deploy a Debian 11.6 host using preseed.
This is my config:
# This preseed file was rendered from the Foreman provisioning template "Preseed default".
# for s293.example.org running Debian 11
# Organization: Default Organization
# Location: FRA1
# Locale
d-i debian-installer/locale string en_US
# country and keyboard settings are automatic. Keep them ...
# ... for wheezy and newer:
d-i keyboard-configuration/xkb-keymap seen true
# Static network configuration.
d-i preseed/early_command string /bin/killall.sh; /bin/netcfg
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/disable_dhcp boolean true
d-i netcfg/get_ipaddress string 12.123.12.149
d-i netcfg/get_netmask string 255.255.255.224
d-i netcfg/get_nameservers string 208.67.222.222 208.67.220.220
d-i netcfg/get_gateway string 12.123.12.129
d-i netcfg/confirm_static boolean true
# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string s293.example.org
d-i netcfg/get_domain string example.org
d-i netcfg/wireless_wep string
d-i hw-detect/load_firmware boolean true
# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.debian.org:80
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i mirror/codename string bullseye
d-i mirror/suite string bullseye
d-i mirror/udeb/suite string bullseye
# Time settings
d-i clock-setup/utc boolean true
d-i time/zone string UTC
# NTP
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string 0.debian.pool.ntp.org
# Set alignment for automatic partitioning
# Choices: cylinder, minimal, optimal
#d-i partman/alignment select cylinder
# Use the first detected hard disk
d-i partman/early_command string \
INSTALL_DISK="$(list-devices disk | head -n1)"; \
debconf-set partman-auto/disk "$INSTALL_DISK"; \
debconf-set grub-installer/bootdev "$INSTALL_DISK"
### Partitioning
# The presently available methods are: "regular", "lvm" and "crypto"
d-i partman-auto/method string lvm
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string vg00
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /var, and /tmp partitions (/usr was removed in jessie)
d-i partman-auto/choose_recipe select atomic
# If you just want to change the default filesystem to something
# else, you can do that without providing a full recipe.
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# User settings
d-i passwd/root-password-crypted password $5$2CwBetOMHDO2Vc9b$J2qdiojE2bhaFqWjbTuH7D3sxdY6mguSFIqZ6hcR9AB
user-setup-udeb passwd/root-login boolean true
d-i passwd/make-user boolean false
user-setup-udeb passwd/make-user boolean false
# Install minimal task set (see tasksel --task-packages minimal)
tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
# Install some base packages
d-i pkgsel/include string lsb-release wget
d-i pkgsel/update-policy select unattended-upgrades
d-i pkgsel/upgrade select none
popularity-contest popularity-contest/participate boolean false
# Boot loader settings
#grub-pc grub-pc/hidden_timeout boolean false
#grub-pc grub-pc/timeout string 10
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note
d-i preseed/late_command string wget -Y off http://foreman.example.org/unattended/finish -O /target/tmp/finish.sh && in-target chmod +x /tmp/finish.sh && in-target /tmp/finish.sh
Hi, it looks like problem with one of snippet, i got same problem, can you review under builded machine PXELINUX template, and see if you provide good ip address or something like netcfg/X.
Problem on my side was with preseed_kernel_options snippet
just to help everyone else hiting this bug, to fix you need to apply the changes described by @ahoiroman in the files preseed_default_pxegrub2.erb and preseed_kernel_options.erb, after that rebuild the system to get the new and correct files. This way my ubuntu18.04 install resurrrected
Ran into this same issue on a brand new fresh installation of foreman 3.7, trying to install debian 11.7.
Is there a cleaner way to apply the fixes than manually changing stuff around in the UI???
I can see the templates directly in the database using su - postgres followed by PAGER=less LESS=-FRXSe PGDATABASE=foreman PSQL_EDITOR=vim psql. (The PAGER and LESS and PSQL_EDITOR values not required of course, but they are good defaults I’ve long used for any interactive Postgres access.) And then \d templates and select ... from templates where ... and so forth.
Just from a devops standpoint, it would be really really nice to have a little one-liner or a short script that would fix my fresh foreman install so the snippets and other templates are correct and functional. Shouldn’t be too hard to achieve, it seems to me, with psql and so forth. Could be a wget of the raw updated file from github and an SQL UPDATE command, maybe using psql backslash commands to read in the file.
Could even get fancy and include in the script an MD5 checksum of the expected contents of the snippets or templates before the update, and then fail out the script if the contents isn’t as expected, so that the script is safe to run—won’t clobber anything but the broken templates that are intended to be updated.
Just speaking as a user, my expectation for a fresh Foreman install would be that installing Debian should be very simple to set up and have function correctly, so anything that makes this easier and require less genius and less trial and error would be a step in the right direction.
My basic question is—exactly which templates should I be changing to what contents, to be maximally in line with the upstream templates provided by Foreman?