diff options
Diffstat (limited to 'kickstart/kickstart')
-rw-r--r-- | kickstart/kickstart/index.php | 183 | ||||
-rw-r--r-- | kickstart/kickstart/ipekatrin-v2.ks | 82 | ||||
-rw-r--r-- | kickstart/kickstart/ipekatrin-v3.ks | 83 | ||||
-rw-r--r-- | kickstart/kickstart/ipekatrin.ks | 57 |
4 files changed, 405 insertions, 0 deletions
diff --git a/kickstart/kickstart/index.php b/kickstart/kickstart/index.php new file mode 100644 index 0000000..7ea2e54 --- /dev/null +++ b/kickstart/kickstart/index.php @@ -0,0 +1,183 @@ +<?php + +#$VERBOSE = 1; + +# disks will be synchronized with k3 +$KATRIN_SERVERS = array( + "ks" => "ipekatrin-v3.ks", + "domain" => "ipe.kit.edu", + "netmask" => "255.255.254.0", + "gw" => "141.52.64.207", + "ns" => "141.52.3.3,141.52.8.18", + "time" => "141.52.8.18", + "sysdisks" => "sdc,sdd", + "append_sol" => "console=tty1 console=ttyS1,115200 earlyprint=serial,ttyS1,115200", + "raid" => "RAID1", + "size" => "80000", + "bootsize" => "2048", + "ethdev" => "enp3s0f1", + "ethdev2" => "enp3s0f0", +); + +$SERVER_LIST = array( + "ipecsavm" => array_merge($KATRIN_SERVERS, array( + "ks" => "ipekatrin-v2.ks", + "macs" => array("66:66:66:13:13:00"), + "ip" => "192.168.26.254", + "netmask" => "255.255.255.0", + "gw" => "192.168.26.117", + "sysdisks" => "sda,sdb", + "raid" => "RAID0", + "size" => "60000", + "ethdev" => "link", + )), + "ipechilinga2" => array_merge($KATRIN_SERVERS, array( + "domain" => "ka.fzk.de", + "macs" => array("48:5b:39:75:fe:ec"), + "headers" => array( + "REMOTE_ADDR" => array("141.52.64.104") + ) + )), + "ipekatrin1" => array_merge($KATRIN_SERVERS, array( + "macs" => array("0c:c4:7a:de:f1:08", "0c:c4:7a:de:f1:09") + )), + "ipekatrin2" => array_merge($KATRIN_SERVERS, array( + "macs" => array("0c:c4:7a:de:f0:e6", "0c:c4:7a:de:f0:e7") + )), + "ipekatrin3" => array_merge($KATRIN_SERVERS, array( + "macs" => array("0c:c4:7a:a8:81:3e", "0c:c4:7a:a8:81:3f"), + "sysdisks" => "sdb,sdc", + "ethdev" => "eno2", + "ethdev2" => "eno1", + )) +); + + +function get_server($srvid) { + global $SERVER_LIST; + + $server = $SERVER_LIST[$srvid]; + + if (!isset($server["fqdn"])) + $server["fqdn"] = "{$srvid}.{$server['domain']}"; + + if (!isset($server["ip"])) + $server["ip"] = gethostbyname($server["fqdn"]); + + $disks = explode(",", $server["sysdisks"]); + if (!isset($server["bootdisk"])) + $server["bootdisk"] = $disks[0]; + + if (!isset($server["disk1"])) + $server["disk1"] = $disks[0]; + + if ((isset($disks[1]))&&(!isset($server["disk2"]))) + $server["disk2"] = $disks[1]; + + + unset($server["macs"]); + unset($server["headers"]); + + return $server; +} + +function find_mac($macs, $mac_header) { + if (!is_array($macs)) $macs = array($macs); + + foreach ($macs as $mac) { + if (preg_match("/$mac/", $mac_header)) + return true; + } + return false; +} + +function find_server_by_mac($mac_header) { + global $SERVER_LIST; + + foreach ($SERVER_LIST as $srvid => $server) { + if (find_mac($server['macs'], $mac_header)) + return get_server($srvid); + } + return false; +} + +function find_server_by_header($http_header, $value) { + global $SERVER_LIST; + + foreach ($SERVER_LIST as $srvid => $server) { + if ((is_array($server["headers"]))&&(isset($server["headers"][$http_header]))) { + $expected = $server["headers"][$http_header]; + if (!is_array($expected)) $expected = array($expected); + foreach ($expected as $re) { + if (preg_match("/$re/", $value)) + return get_server($srvid); + } + } + } + return false; +} + +function find_server() { + global $_SERVER; + + $headers = getallheaders(); + for ($i = 0; $i < 10; $i++) { + $if = "X-RHN-Provisioning-MAC-$i"; + if (!isset($headers[$if])) break; + + $server = find_server_by_mac($headers[$if]); + if ($server) return $server; + } + + foreach ($_SERVER as $header => $value) { + $server = find_server_by_header($header, $value); + if ($server) return $server; + } + + return false; +} + + + + +#echo "Request from: " . $_SERVER["REMOTE_ADDR"]; + +$server = find_server(); +if (!$server) { + $f = fopen("/srv/www/htdocs/ands/logs/kickstart-new.log", "a+"); + if ($f) { + fwrite($f, print_r($_SERVER, true)); + fwrite($f, print_r(getallheaders(), true)); + fclose($f); + } + return; +} + +$ks = file_get_contents($server["ks"]); + +$patterns=array(); $values=array(); +foreach ($server as $key => $val) { + array_push($patterns, "/@" . strtoupper($key) . "@/"); + array_push($values, $val); +} + +$ks = preg_replace($patterns, $values, $ks); + +if ($VERBOSE) { + $f = fopen("/srv/www/htdocs/ands/logs/kickstart.log", "a+"); + if ($f) { + fwrite($f, "-----------------------------------------------------\n"); + fwrite($f, print_r($server, true)); + fwrite($f, print_r($_SERVER, true)); + fwrite($f, print_r(getallheaders(), true)); + fwrite($f, "-----------------------------------------------------\n"); + fwrite($f, $ks); + fwrite($f, "=====================================================\n"); + fclose($f); + } +} + +header("Content-type: text/plain"); +echo $ks; + +?> diff --git a/kickstart/kickstart/ipekatrin-v2.ks b/kickstart/kickstart/ipekatrin-v2.ks new file mode 100644 index 0000000..5adc31f --- /dev/null +++ b/kickstart/kickstart/ipekatrin-v2.ks @@ -0,0 +1,82 @@ +#version=DEVEL + +# System authorization information +auth --enableshadow --passalgo=sha512 + +# Use CDROM installation media +cdrom + +# Use graphical install (graphical is enforce by vnc requested at kernel args) +#text +graphical + +# Run the Setup Agent on first boot +firstboot --enable +ignoredisk --only-use=@SYSDISKS@ +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information (device=link signifies first device link active) +network --device=link --bootproto=static --ip=@IP@ --netmask=@NETMASK@ --gateway=@GW@ --nameserver=@NS@ --noipv6 --onboot=on --activate +#network --bootproto=dhcp --device=eth0 --ipv6=auto --activate +network --hostname=@FQDN@ + + +# Partition clearing information +clearpart --all --drives=@SYSDISKS@ +zerombr + +# System bootloader configuration +bootloader --location=mbr --driveorder=@SYSDISKS@ --boot-drive=@BOOTDISK@ --append=" crashkernel=auto @APPEND_SOL@" + +#autopart --type=lvm +#reqpart --add-boot +part raid.01 --ondisk=@DISK1@ --asprimary --size @BOOTSIZE@ +part raid.02 --ondisk=@DISK2@ --asprimary --size @BOOTSIZE@ +part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended +part swap --ondisk=@DISK2@ --asprimary --fstype=swap --recommended +part raid.03 --ondisk=@DISK1@ --asprimary --size @SIZE@ --grow +part raid.04 --ondisk=@DISK2@ --asprimary --size @SIZE@ --grow +raid /boot --level=@RAID@ --device md0 raid.01 raid.02 --fstype=ext4 +raid pv.01 --level=@RAID@ --device=md1 raid.03 raid.04 +volgroup sysvg pv.01 +logvol / --vgname=sysvg --size=@SIZE@ --name=lv_root --fstype=ext4 + +# Root password (new) +rootpw --iscrypted $6$ihAbktYN$T36KRAmi8ccjNrE5Y0gEl11Rb/dl3GjemejAJyHVzrAL51/st7aMZ0dqnMIkhubX/gUcPe5LdTlJODC9D/60h0 +# Root passowrd (old) +#rootpw --iscrypted $6$ioKrEQSxzYypx2HZ$jiynrl6knbmhbL066k.HjmxcwvQwBsT53LPlp2fRdkg2E1E7Gy4gwxaZ0m86rbD6q4dTaWdYfKhDVSij6N1Y7. + +# System services +services --enabled="chronyd" +# System timezone +timezone Europe/Berlin --isUtc --ntpservers=@TIME@ +user --groups=wheel --name=csa --gecos="Suren A. Chilingaryan" + +# SELinux configuration +#selinux --disabled + +# Do not configure the X Window System +skipx + +install +poweroff + + +%packages +@^minimal +@core +chrony +kexec-tools + +%end +%addon com_redhat_kdump --enable --reserve-mb='auto' +%end + +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty +%end diff --git a/kickstart/kickstart/ipekatrin-v3.ks b/kickstart/kickstart/ipekatrin-v3.ks new file mode 100644 index 0000000..ae5aa35 --- /dev/null +++ b/kickstart/kickstart/ipekatrin-v3.ks @@ -0,0 +1,83 @@ +#version=DEVEL + +# System authorization information +auth --enableshadow --passalgo=sha512 + +# Use CDROM installation media +cdrom + +# Use graphical install (graphical is enforce by vnc requested at kernel args) +#text +graphical + +# Run the Setup Agent on first boot +firstboot --enable +ignoredisk --only-use=@SYSDISKS@ +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information (device=link signifies first device link active) +network --device=@ETHDEV@ --bootproto=static --ip=@IP@ --netmask=@NETMASK@ --gateway=@GW@ --nameserver=@NS@ --noipv6 --onboot=on --activate +#network --device=@ETHDEV2@ --bootproto=static --ip=@IP@ --netmask=@NETMASK@ --gateway=@GW@ --nameserver=@NS@ --noipv6 --onboot=off --activate +#network --bootproto=dhcp --device=eth0 --ipv6=auto --activate +network --hostname=@FQDN@ + + +# Partition clearing information +clearpart --all --drives=@SYSDISKS@ +zerombr + +# System bootloader configuration +bootloader --location=mbr --driveorder=@SYSDISKS@ --boot-drive=@BOOTDISK@ --append=" crashkernel=auto @APPEND_SOL@" + +#autopart --type=lvm +#reqpart --add-boot +part raid.01 --ondisk=@DISK1@ --asprimary --size @BOOTSIZE@ +part raid.02 --ondisk=@DISK2@ --asprimary --size @BOOTSIZE@ +part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended +part swap --ondisk=@DISK2@ --asprimary --fstype=swap --recommended +part raid.03 --ondisk=@DISK1@ --asprimary --size @SIZE@ --grow +part raid.04 --ondisk=@DISK2@ --asprimary --size @SIZE@ --grow +raid /boot --level=@RAID@ --device md0 raid.01 raid.02 --fstype=ext4 +raid pv.01 --level=@RAID@ --device=md1 raid.03 raid.04 +volgroup sysvg pv.01 +logvol / --vgname=sysvg --size=@SIZE@ --name=lv_root --fstype=ext4 + +# Root password (new) +rootpw --iscrypted $6$ihAbktYN$T36KRAmi8ccjNrE5Y0gEl11Rb/dl3GjemejAJyHVzrAL51/st7aMZ0dqnMIkhubX/gUcPe5LdTlJODC9D/60h0 +# Root passowrd (old) +#rootpw --iscrypted $6$ioKrEQSxzYypx2HZ$jiynrl6knbmhbL066k.HjmxcwvQwBsT53LPlp2fRdkg2E1E7Gy4gwxaZ0m86rbD6q4dTaWdYfKhDVSij6N1Y7. + +# System services +services --enabled="chronyd" +# System timezone +timezone Europe/Berlin --isUtc --ntpservers=@TIME@ +user --groups=wheel --name=csa --gecos="Suren A. Chilingaryan" + +# SELinux configuration +#selinux --disabled + +# Do not configure the X Window System +skipx + +install +poweroff + + +%packages +@^minimal +@core +chrony +kexec-tools + +%end +%addon com_redhat_kdump --enable --reserve-mb='auto' +%end + +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty +%end diff --git a/kickstart/kickstart/ipekatrin.ks b/kickstart/kickstart/ipekatrin.ks new file mode 100644 index 0000000..b394ca8 --- /dev/null +++ b/kickstart/kickstart/ipekatrin.ks @@ -0,0 +1,57 @@ +#version=DEVEL +# System authorization information +auth --enableshadow --passalgo=sha512 +# Use CDROM installation media +cdrom +# Use graphical install (graphical is enforce by vnc requested at kernel args) +#graphical +text + +# Run the Setup Agent on first boot +firstboot --enable +ignoredisk --only-use=@SYSDISKS@ +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +#network --bootproto=dhcp --device=eth0 --ipv6=auto --activate +network --bootproto=static --ip=@IP@ --netmask=@NETMASK@ --gateway=@GW@ --nameserver=@NS@ --device=eth0 --ipv6=auto --activate +network --hostname=@FQDN@ + +# Root password +rootpw --iscrypted $6$ioKrEQSxzYypx2HZ$jiynrl6knbmhbL066k.HjmxcwvQwBsT53LPlp2fRdkg2E1E7Gy4gwxaZ0m86rbD6q4dTaWdYfKhDVSij6N1Y7. +# System services +services --enabled="chronyd" +# System timezone +timezone Europe/Berlin --isUtc --ntpservers=@TIME@ +user --groups=wheel --name=csa --password=$6$H8NeYbDfSuTtJKmA$pyUj57Ao1gAyT2C8ijivRxTMTkTClpOFUigmxsgKZ1L71Np6URTT4s6PU6WsuoEQgHgo9XjJNGePg/RneBY9a1 --iscrypted --gecos="Suren A. Chilingaryan" +# System bootloader configuration +bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=@BOOTDISK@ +autopart --type=lvm +# Partition clearing information +clearpart --all --initlabel --drives=@SYSDISKS@ + + + +%packages +@^minimal +@core +chrony +kexec-tools + +%end + +%addon com_redhat_kdump --enable --reserve-mb='auto' + +%end + +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty +%end + + +poweroff |