khuedoan-homelab/metal/roles/pxe_server/templates/kickstart.ks.j2
Khue Doan 9966e23a03 perf(metal): increase root partition size
32GiB gets filled fairly quickly.
2024-03-26 23:34:54 +07:00

68 lines
1.7 KiB
Django/Jinja

#version=RHEL8
# Do not use graphical install
text
# Keyboard layouts
keyboard --xlayouts='us'
# System language
lang en_US.UTF-8
# Partition clearing information
clearpart --all --drives={{ hostvars[item]['disk'] }}
# Partitioning
ignoredisk --only-use={{ hostvars[item]['disk'] }}
partition /boot/efi --fstype=vfat --size=512
partition / --fstype=ext4 --size=65536
# Network information
network --bootproto=static --device={{ hostvars[item]['network_interface'] }} --ip={{ hostvars[item]['ansible_host'] }} --gateway={{ ansible_default_ipv4.gateway }} --nameserver={{ dns_server }} --netmask={{ ansible_default_ipv4.netmask }} --ipv6=auto --hostname={{ hostvars[item]['inventory_hostname'] }} --activate
# Use network installation
repo --name="Repository" --baseurl=http://{{ ansible_default_ipv4.address }}/os
url --url="http://{{ ansible_default_ipv4.address }}/os"
# Disable Setup Agent on first boot
firstboot --disable
# Do not configure the X Window System
skipx
# Enable NTP
services --enabled="chronyd"
# System timezone
timezone {{ timezone }} --utc
# Create user (locked by default)
user --groups=wheel --name=admin
# Add SSH key
sshkey --username=root "{{ ssh_public_key }}"
# Disable root password login
rootpw --lock
# Disable SELinux
selinux --disabled
# Disable firewall
firewall --disabled
%packages
@^custom-environment
openssh-server
%end
# Create a raw partition for Ceph using the remaining space
# Using a post script because there is no built-in feature in Kickstart
# The three empty lines are equivalent to pressing Enter to use the default values for:
# - Partition number
# - First sector
# - Last sector
%post
fdisk /dev/{{ hostvars[item]['disk'] }} << EOF
new
write
EOF
%end
reboot