#System language lang fr_FR.UTF-8 #Language modules to install langsupport fr_FR.UTF-8 #System keyboard keyboard fr #System mouse mouse #System timezone timezone --utc Europe/Paris #Root password rootpw --iscrypted ******* #Initial user user premier --fullname "premier" --iscrypted --password ******* #Reboot after installation reboot #Use text mode install text #Install OS instead of upgrade install #Use cdrom installation cdrom #System bootloader configuration bootloader --location=mbr --md5pass=******* #Preseed Multiboot support script preseed partman/early_command string /tmp/part.sh #Clear the Master Boot Record zerombr yes #Partitionning %include /tmp/part_conf #System authorization infomation auth --useshadow --enablemd5 #Network information network --bootproto=dhcp --device=eth0 #Firewall configuration firewall --disabled #Do not configure the X Window System skipx ###PRE##################################################################################### %pre # fix https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1347726 umount /media 2>/dev/null # init early partitionning script cat <<\EOF > /tmp/part.sh # detect disk name for dev in sda vda hda nvme0n1; do if [ -d /sys/block/${dev} ] && [ $(cat /sys/block/${dev}/removable || echo "1") = 0 ]; then disk=${dev}; fi; done # support new SSD if [ ${disk} = "nvme0n1" ]; then win_part="p1"; else echo win_part="1"; fi # change to tty6 to print shell output exec < /dev/tty6 > /dev/tty6 2> /dev/tty6 chvt 6 # restore partition table from file sfdisk /dev/${disk} << EOSF unit: sectors /dev/${disk}${win_part} : start= 2048, size= 314572800, Id=7, bootable EOSF # generate recipe partman file cat <<\EOSF > /tmp/recipe boot-root :: 40 50 100 ext4 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot } . 500 10000 1000000000 ext4 method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . 64 512 300% linux-swap method{ swap } format{ } . EOSF # generate included partman file # https://help.ubuntu.com/lts/installation-guide/amd64/apbs04.html#preseed-partman cat << EOSF > /tmp/part_conf # disk partitioning information preseed partman-auto/disk string /dev/${disk} # partitionning method preseed partman-auto/method string regular preseed partman-auto/expert_recipe_file string /tmp/recipe EOSF # debug read pause # print installer chvt 1 EOF # set exec to partitionning script chmod +x /tmp/part.sh # disable keyboard #rmmod usbhid #echo "blacklist usbhid" > /etc/modprobe.d/keyboard.conf ###POST#################################################################################### %post # change to tty6 to print shell output exec < /dev/tty6 > /dev/tty6 2> /dev/tty6 chvt 6 # install ansible export http_proxy="http://prodsif-pack:3128" echo 'Acquire::http::Proxy "http://prodsif-pack:3142";' > /etc/apt/apt.conf apt update apt install -y python-pip python-setuptools python-virtualenv python-requests python-openssl git wget ssh expect pip install ansible # put ansible key to read repo mkdir -p /root/.ssh/ wget "https://prodpeda-cesium/kickstart/id_rsa_ansible" -O /root/.ssh/id_rsa_ansible --quiet chmod 600 /root/.ssh/id_rsa_ansible # run ansible configuration unbuffer /usr/local/bin/ansible-pull -d /root/playbooks-awx.git -C master -i /root/playbooks-awx.git/dynamic_host.py -U git@prodpeda-cesium:playbooks-awx.git --key-file=/root/.ssh/id_rsa_ansible --accept-host-key | tee /var/log/ansible-pull-kickstart.log # set info file mkdir -p /root/system deploy_date=$(LC_ALL=C date) cat << EOF > /root/system/deploy_info Date : $deploy_date EOF # remove link before reboot wget "https://prodpeda-cesium/dsinux/dsmaster.php?action=pxe-unlock&target=$(hostname)&password=******" --quiet