#Generated by Kickstart Configurator #platform=AMD64 or Intel EM64T #System language lang en_GB #Language modules to install langsupport en_GB #System keyboard keyboard gb #System mouse mouse #System timezone timezone Europe/London #Root password rootpw --disabled #Initial user user install --fullname "Installation User" --password VerySecretPassword #Reboot after installation reboot #Use text mode install text #Install OS instead of upgrade install #Use Web installation url --url http://example.com/Ubuntu_16.04 #System bootloader configuration bootloader --location=mbr #Clear the Master Boot Record zerombr yes #Disk partitioning information # Suitable for upgrading for pontus ignoredisk --onlyuse=sda part / --onpart=sda1 part swap --onpart=sda5 #System authorization infomation auth --useshadow --enablemd5 #Network information network --bootproto=dhcp --device=eth0 #Firewall configuration firewall --enabled #X Window System configuration information xconfig --depth=32 --resolution=1600x1200 --defaultdesktop=GNOME --startxonboot %packages grub-common grub2-common grub-pc grub-pc-bin # Needed to get Puppet install to work. wget apt #add-apt-key #python-software-properties # Post install - use mirror repositories # to replace minimal repos, then # set up Puppet from their repositories # and get a certificate from admin-server %post --interpreter /bin/bash apt-get install wget wget http://admin-server.example.com/Ubuntu_16.04/post-install-sources.list cp post-install-sources.list /etc/apt/sources.list apt-get update apt-get install -y --force-yes add-apt-key python-software-properties apt-get install -y --force-yes lightdm snmp snmp-mibs-downloader snmpd ln -s /local/home /home/raid mkdir -p /local/data/public chmod 777 /local/data/public /usr/lib/lightdm/lightdm-set-defaults -l false -m true apt-add-repository -y ppa:ubuntu-x-swat/x-updates # Launchpad PPA GPG key apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B22AB97AF1CDFA9 # Puppetlabs GPG key apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 1054B7A24BD6EC30 apt-get update -y apt-get install nvidia-current --reinstall -y apt-get dist-upgrade -y net-snmp-config --create-snmpv3-user -ro -a MD5 -A wibble -x DES -X wibble admin # Set up Puppet apt-key adv --recv-key --keyserver pgp.mit.edu 4BD6EC30 apt-add-repository "deb http://apt.puppetlabs.com xenial PC1 dependencies" apt-add-repository "deb-src http://apt.puppetlabs.com xenial PC1 dependencies" apt-get update -y apt-get install -y puppet-agent cd /etc/puppet wget http://admin-server.example.com/Ubuntu_16.04/etckeeper-commit-pre wget http://admin-server.example.com/Ubuntu_16.04/etckeeper-commit-post chown puppet:puppet /etc/puppet/etckeeper-commit-pre /etc/puppet/etckeeper-commit-post chmod 550 /etc/puppet/etckeeper-commit-post /etc/puppet/etckeeper-commit-pre puppet agent --no-daemonize --verbose --onetime --waitforcert 15 --server admin-server.example.com # We then repeat trying to update until we actually get /etc/auto.local # this indicates that the sysadmin has set the type of the server # in Foreman, i.e. the server has now got a valid Puppet class setup. while true; do puppet agent --no-daemonize --verbose --onetime --server admin-server.example.com sleep 60 if [[ -e /etc/auto.local ]]; then break fi done