mirror of
https://github.com/BluemediaDev/homelab.git
synced 2025-05-07 13:31:37 +02:00
Initial commit
This commit is contained in:
commit
50f2a54331
21 changed files with 276 additions and 0 deletions
20
metal/roles/pxe-server/templates/dhcpd.conf.j2
Normal file
20
metal/roles/pxe-server/templates/dhcpd.conf.j2
Normal file
|
@ -0,0 +1,20 @@
|
|||
option space pxelinux;
|
||||
option pxelinux.magic code 208 = string;
|
||||
option pxelinux.configfile code 209 = text;
|
||||
option pxelinux.pathprefix code 210 = text;
|
||||
option pxelinux.reboottime code 211 = unsigned integer 32;
|
||||
option architecture-type code 93 = unsigned integer 16;
|
||||
|
||||
subnet {{ subnet }} netmask {{ netmask }} {
|
||||
option routers {{ gateway }};
|
||||
range {{ subnet | ansible.netcommon.ipmath(3) }} {{ subnet | ansible.netcommon.ipmath(254) }};
|
||||
|
||||
class "pxeclients" {
|
||||
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
|
||||
next-server {{ ansible_default_ipv4.address }};
|
||||
|
||||
if option architecture-type = 00:07 {
|
||||
filename "grubx64.efi";
|
||||
}
|
||||
}
|
||||
}
|
10
metal/roles/pxe-server/templates/grub.cfg.j2
Normal file
10
metal/roles/pxe-server/templates/grub.cfg.j2
Normal file
|
@ -0,0 +1,10 @@
|
|||
set timeout=1
|
||||
|
||||
menuentry 'Auto install Debian Bullseye (PXE)' {
|
||||
set background_color=black
|
||||
linux linux \
|
||||
vga=788 \
|
||||
url=http://{{ ansible_default_ipv4.address }}/preseed/${net_default_mac}.conf \
|
||||
--- auto quiet
|
||||
initrd initrd.gz
|
||||
}
|
78
metal/roles/pxe-server/templates/preseed.cfg.j2
Normal file
78
metal/roles/pxe-server/templates/preseed.cfg.j2
Normal file
|
@ -0,0 +1,78 @@
|
|||
# For documentation see: https://www.debian.org/releases/stable/example-preseed.txt
|
||||
|
||||
# Set default locale and keyboard layout
|
||||
d-i debian-installer/locale string {{ locale | default('en_US.UTF-8') }}
|
||||
d-i keyboard-configuration/xkb-keymap select {{ keyboard_layout | default('de') }}
|
||||
|
||||
# Set network interface used by default
|
||||
d-i netcfg/choose_interface select auto
|
||||
|
||||
# Static network config
|
||||
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/get_ipaddress string {{ hostvars[item]['ansible_host'] }}
|
||||
d-i netcfg/get_netmask string {{ netmask }}
|
||||
d-i netcfg/get_gateway string {{ gateway }}
|
||||
d-i netcfg/get_nameservers string {{ nameserver }}
|
||||
d-i netcfg/confirm_static boolean true
|
||||
|
||||
# These values will be overwritten if set by dhcp, but the entries will get rid of the correscponding questions
|
||||
d-i netcfg/get_hostname string {{ hostvars[item]['inventory_hostname'] | default('unassigned-hostname') }}
|
||||
d-i netcfg/get_domain string {{ domain | default('unassigned-domain') }}
|
||||
|
||||
# Force hostname regarding of value set by dhcp
|
||||
d-i netcfg/hostname string {{ hostvars[item]['inventory_hostname'] | default('unassigned-hostname') }}
|
||||
|
||||
# Load non-free firmware for hardware by default
|
||||
d-i hw-detect/load_firmware boolean true
|
||||
|
||||
# Setup package mirrror
|
||||
d-i mirror/protocol string {{ mirror_proto | default('http') }}
|
||||
d-i mirror/country string manual
|
||||
d-i mirror/http/hostname string {{ mirror | default('deb.debian.org') }}
|
||||
d-i mirror/http/directory string {{ mirror_dir | default('/debian') }}
|
||||
d-i mirror/http/proxy string {{ mirror_proxy | default('') }}
|
||||
|
||||
# Disable root user - normal user (see below) will have sudo permissions
|
||||
d-i passwd/root-login boolean false
|
||||
|
||||
# Create new user
|
||||
d-i passwd/user-fullname string {{ user_fullname | default('Debian User') }}
|
||||
d-i passwd/username string {{ username | default('debian') }}
|
||||
d-i passwd/user-password password {{ password | default('insecure') }}
|
||||
d-i passwd/user-password-again password {{ password | default('insecure') }}
|
||||
|
||||
# Setup timezone and NTP server
|
||||
d-i clock-setup/utc boolean true
|
||||
d-i time/zone string {{ timezone | default('UTC') }}
|
||||
d-i clock-setup/ntp-server string {{ ntp_server | default('de.pool.ntp.org') }}
|
||||
|
||||
# Autoformat disk
|
||||
d-i partman-auto/disk string {{ hostvars[item]['disk'] | default('/dev/sda') }}
|
||||
d-i partman-auto/method string regular
|
||||
d-i partman-auto/choose_recipe select atomic
|
||||
d-i partman-partitioning/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
|
||||
|
||||
# Remove install cd sources from /etc/sources.list
|
||||
d-i apt-setup/cdrom/set-first boolean false
|
||||
d-i apt-setup/disable-cdrom-entries boolean true
|
||||
|
||||
# Install openssh-server and basic system tools
|
||||
d-i pkgsel/run_tasksel boolean false
|
||||
d-i pkgsel/include string openssh-server build-essential
|
||||
d-i pkgsel/upgrade select safe-upgrade
|
||||
|
||||
# Disable package reporting
|
||||
popularity-contest popularity-contest/participate boolean false
|
||||
|
||||
# Install grub to specified device
|
||||
d-i grub-installer/only_debian boolean true
|
||||
d-i grub-installer/bootdev string {{ hostvars[item]['disk'] | default('/dev/sda') }}
|
||||
|
||||
# Reboot to installed system without confirmation
|
||||
d-i finish-install/reboot_in_progress note
|
Loading…
Add table
Add a link
Reference in a new issue