2022-09-08 13:01:32 +00:00
|
|
|
### Install from network
|
|
|
|
### Configure network information for target system and activate network devices in the installer environment (optional)
|
|
|
|
### --onboot enable device at a boot time
|
|
|
|
### --device device to be activated and / or configured with the network command
|
|
|
|
### --bootproto method to obtain networking configuration for device (default dhcp)
|
|
|
|
### --noipv6 disable IPv6 on this device
|
|
|
|
###
|
|
|
|
### network --bootproto=static --ip=172.16.11.200 --netmask=255.255.255.0 --gateway=172.16.11.200 --nameserver=172.16.11.4 --hostname centos-linux-8
|
|
|
|
network --bootproto=dhcp --device=link --activate --onboot=on
|
|
|
|
|
|
|
|
### Use the Hetzner mirror for fast installations
|
|
|
|
url --url="${hcloud_mirror}/BaseOS/x86_64/os/"
|
|
|
|
repo --name="AppStream" --baseurl="${hcloud_mirror}/AppStream/x86_64/os/"
|
|
|
|
|
|
|
|
### Performs the kickstart installation in text mode.
|
|
|
|
### By default, kickstart installations are performed in graphical mode.
|
|
|
|
text
|
|
|
|
|
|
|
|
### Accepts the End User License Agreement.
|
|
|
|
eula --agreed
|
|
|
|
|
|
|
|
### Sets the language to use during installation and the default language to use on the installed system.
|
|
|
|
lang ${vm_guest_os_language}
|
|
|
|
|
|
|
|
### Sets the default keyboard type for the system.
|
|
|
|
keyboard ${vm_guest_os_keyboard}
|
|
|
|
|
|
|
|
### Set initial root password
|
2024-08-08 07:46:30 +00:00
|
|
|
rootpw ${build_password}
|
2022-09-08 13:01:32 +00:00
|
|
|
|
|
|
|
### Configure firewall settings for the system.
|
|
|
|
### --enabled reject incoming connections that are not in response to outbound requests
|
|
|
|
### --ssh allow sshd service through the firewall
|
|
|
|
firewall --enabled --ssh
|
|
|
|
|
|
|
|
### Sets up the authentication options for the system.
|
|
|
|
### The SSDD profile sets sha512 to hash passwords. Passwords are shadowed by default
|
|
|
|
### See the manual page for authselect-profile for a complete list of possible options.
|
|
|
|
authselect select sssd
|
|
|
|
|
|
|
|
### Sets the state of SELinux on the installed system.
|
|
|
|
### Defaults to enforcing.
|
|
|
|
selinux --enforcing
|
|
|
|
|
|
|
|
### Sets the system time zone.
|
|
|
|
timezone ${vm_guest_os_timezone} --utc
|
|
|
|
|
|
|
|
### Sets how the boot loader should be installed.
|
|
|
|
bootloader --location=mbr
|
|
|
|
|
|
|
|
### Initialize any invalid partition tables found on disks.
|
|
|
|
zerombr
|
|
|
|
|
|
|
|
### Removes partitions from the system, prior to creation of new partitions.
|
|
|
|
### By default, no partitions are removed.
|
|
|
|
### --linux erases all Linux partitions.
|
|
|
|
### --initlabel Initializes a disk (or disks) by creating a default disk label for all disks in their respective architecture.
|
|
|
|
clearpart --all --initlabel
|
|
|
|
|
|
|
|
### Modify partition sizes for the virtual machine hardware.
|
|
|
|
### Create primary system partitions.
|
2024-04-11 21:40:33 +00:00
|
|
|
part /boot --fstype xfs --size=2048 --label=BOOTFS
|
2022-09-08 13:01:32 +00:00
|
|
|
part /boot/efi --fstype vfat --size=512 --label=EFIFS
|
2024-04-11 21:40:33 +00:00
|
|
|
part pv.01 --size=17 --grow
|
2022-09-08 13:01:32 +00:00
|
|
|
|
|
|
|
### Create a logical volume management (LVM) group.
|
|
|
|
volgroup vg00 --pesize=4096 pv.01
|
|
|
|
|
|
|
|
### Modify logical volume sizes for the virtual machine hardware.
|
|
|
|
### Create logical volumes.
|
2024-04-14 10:39:15 +00:00
|
|
|
logvol / --fstype xfs --name=lv_root --vgname=vg00 --size=6144 --label=ROOTFS
|
2024-04-11 21:40:33 +00:00
|
|
|
logvol /home --fstype xfs --name=lv_home --vgname=vg00 --size=2048 --label=HOMEFS
|
2024-04-14 10:39:15 +00:00
|
|
|
logvol /tmp --fstype xfs --name=lv_tmp --vgname=vg00 --size=1024 --label=TMPFS --fsoptions="nosuid,noexec,nodev"
|
|
|
|
logvol /var --fstype xfs --name=lv_var --vgname=vg00 --size=4096 --label=VARFS --fsoptions="nosuid"
|
|
|
|
logvol /var/tmp --fstype xfs --name=lv_vartmp --vgname=vg00 --size=1024 --label=LOGFS --fsoptions="nosuid,noexec,nodev"
|
2024-04-11 21:40:33 +00:00
|
|
|
logvol /var/log --fstype xfs --name=lv_log --vgname=vg00 --size=1024 --label=LOGFS --fsoptions="nosuid,noexec,nodev"
|
2024-04-14 10:39:15 +00:00
|
|
|
logvol /var/log/audit --fstype xfs --name=lv_audit --vgname=vg00 --size=1024 --label=AUDITFS --fsoptions="nosuid,noexec,nodev"
|
2022-09-08 13:01:32 +00:00
|
|
|
|
|
|
|
### Modifies the default set of services that will run under the default runlevel.
|
|
|
|
services --enabled=NetworkManager,sshd
|
|
|
|
|
|
|
|
### Do not configure X on the installed system.
|
|
|
|
skipx
|
|
|
|
|
|
|
|
### Disable firstboot.
|
|
|
|
firstboot --disable
|
|
|
|
|
|
|
|
### Packages selection.
|
|
|
|
%packages
|
|
|
|
@^minimal-environment
|
|
|
|
kexec-tools
|
|
|
|
openssh-server
|
|
|
|
openssh-clients
|
|
|
|
sudo
|
|
|
|
curl
|
|
|
|
python3
|
|
|
|
python3-libselinux
|
|
|
|
jq
|
2022-09-20 06:45:09 +00:00
|
|
|
grubby
|
2022-09-08 13:01:32 +00:00
|
|
|
-aic94xx-firmware
|
|
|
|
-atmel-firmware
|
|
|
|
-b43-openfwwf
|
|
|
|
-bfa-firmware
|
|
|
|
-ipw2100-firmware
|
|
|
|
-ipw2200-firmware
|
|
|
|
-ivtv-firmware
|
|
|
|
-iwl100-firmware
|
|
|
|
-iwl1000-firmware
|
|
|
|
-iwl3945-firmware
|
|
|
|
-iwl4965-firmware
|
|
|
|
-iwl5000-firmware
|
|
|
|
-iwl5150-firmware
|
|
|
|
-iwl6000-firmware
|
|
|
|
-iwl6000g2a-firmware
|
|
|
|
-iwl6050-firmware
|
|
|
|
-libertas-usb8388-firmware
|
|
|
|
-ql2100-firmware
|
|
|
|
-ql2200-firmware
|
|
|
|
-ql23xx-firmware
|
|
|
|
-ql2400-firmware
|
|
|
|
-ql2500-firmware
|
|
|
|
-rt61pci-firmware
|
|
|
|
-rt73usb-firmware
|
|
|
|
-xorg-x11-drv-ati-firmware
|
|
|
|
-zd1211-firmware
|
|
|
|
%end
|
|
|
|
|
|
|
|
### Post-installation commands.
|
|
|
|
%post
|
|
|
|
|
2024-04-15 14:40:22 +00:00
|
|
|
dd if=/dev/zero of=/swapfile bs=1M count=1000
|
|
|
|
chmod 600 /swapfile
|
|
|
|
mkswap /swapfile
|
2024-04-17 07:58:04 +00:00
|
|
|
echo '/swapfile none swap defaults 0 0' | tee -a /etc/fstab
|
2024-04-15 14:40:22 +00:00
|
|
|
|
2022-09-08 13:01:32 +00:00
|
|
|
dnf makecache
|
|
|
|
dnf install -y epel-release
|
|
|
|
dnf makecache
|
|
|
|
dnf install -y cloud-init
|
|
|
|
dnf clean all
|
|
|
|
|
|
|
|
touch /etc/cloud/cloud-init.disabled
|
|
|
|
cat >/etc/cloud/cloud.cfg.d/90-hetznercloud.cfg <<EOF
|
|
|
|
${files_hetznercloud_default_init}
|
|
|
|
EOF
|
|
|
|
cat >/etc/cloud/cloud.cfg.d/92-hetznercloud-ds.cfg <<EOF
|
|
|
|
${files_hetznercloud_ds_init}
|
|
|
|
EOF
|
|
|
|
cat >/etc/cloud/cloud.cfg.d/93-hetznercloud.cfg <<EOF
|
|
|
|
${files_hetznercloud_init}
|
|
|
|
EOF
|
2022-09-09 09:06:26 +00:00
|
|
|
|
|
|
|
mkdir -p /etc/systemd/system/getty@tty1.service.d
|
|
|
|
cat >/etc/systemd/system/getty@tty1.service.d/override.conf <<EOF
|
|
|
|
[Unit]
|
|
|
|
After=cloud-init.target
|
|
|
|
EOF
|
2022-09-08 13:01:32 +00:00
|
|
|
echo "Completed cloud-init step!"
|
|
|
|
|
|
|
|
cat >/usr/local/bin/hcloud-metadata <<\EOF
|
|
|
|
${files_hcloud_metadata}
|
|
|
|
EOF
|
|
|
|
chmod 700 /usr/local/bin/hcloud-metadata
|
|
|
|
|
|
|
|
mkdir /root/.ssh/
|
|
|
|
chmod 700 /root/.ssh/
|
|
|
|
cat >/etc/systemd/system/hcloud-ssh-keys.service <<EOF
|
|
|
|
${files_hcloud_ssh_keys_service}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
systemctl enable hcloud-ssh-keys.service
|
2023-03-26 19:40:20 +00:00
|
|
|
|
|
|
|
cat >/etc/NetworkManager/conf.d/eth0.conf <<\EOF
|
|
|
|
${files_hcloud_nm_eth0}
|
|
|
|
EOF
|
|
|
|
chmod 644 /etc/NetworkManager/conf.d/eth0.conf
|
2022-09-08 13:01:32 +00:00
|
|
|
%end
|
|
|
|
|
|
|
|
### Reboot after the installation is complete.
|
|
|
|
### --eject attempt to eject the media before rebooting.
|
|
|
|
reboot --eject
|