# kickstart template for server,user,tintin # System authorization information auth --useshadow --enablemd5 --enableldap --ldapserver=ldap.uppmax.uu.se --ldapbasedn=dc=uppmax,dc=uu,dc=se --ldaploadcacert=http://172.18.37.100/f18ec9bb.0 # System bootloader configuration bootloader --location=mbr # fff # Use text install text skipx # Firewall configuration firewall --disabled # Run the Setup Agent on first boot firstboot --disable keyboard --vckeymap=sv-latin1 --xlayouts='se' lang en_US.UTF-8 #logging --level=info logging --level=debug # Use network installation url --url=http://172.18.37.100/cblr/links/centos7-x86_64 # If any cobbler repo definitions were referenced in the kickstart profile, include them here. repo --name=epel7 --baseurl=http://172.18.37.100/cobbler/repo_mirror/epel7 repo --name=source-1 --baseurl=http://172.18.37.100/cobbler/ks_mirror/centos7 #Network # Network information # Using "new" style networking config, by matching networking information to the physical interface's # MAC-address %include /tmp/pre_install_network_config reboot rootpw --iscrypted $1$smmjoA3e$Ya/o8jOubHy9jRT7GmliO1 selinux --disabled timezone --utc Europe/Stockholm install # Disk partitioning information # autopart # Inkludera text filer som jag skapat tidigare i pre %include /tmp/pre_partitiontable %pre set -x -v exec 1>/tmp/ks-pre.log 2>&1 # Once root's homedir is there, copy over the log. while : ; do sleep 10 if [ -d /mnt/sysimage/root ]; then cp /tmp/ks-pre.log /mnt/sysimage/root/ logger "Copied %pre section log to system" break fi done & exec >/root/ks-pre-anaconda.log 2>&1 #tail -f /root/ks-pre-anaconda.log >/dev/tty3 & tail -f /root/ks-pre-anaconda.log | fold -w 80 -s > /dev/console & chvt 3 # Do we need this? #ip route add 10.0.0.0/8 via 130.238.136.4 # Badblock for att testa disk # time badblocks -b 4096 -c 98304 -p 0 -w /dev/sda # Running pre triggers curl "http://172.18.37.100/cblr/svc/op/trig/mode/pre/system/i100" -o /dev/null echo "network --device=eno1 --bootproto=static --ip=172.18.13.100 --netmask=255.255.252.0 --gateway=172.18.12.1 --ipv6=2001:6b0:b:aa06::100a --ipv6gateway=2001:6b0:b:aa06::fff --nameserver=172.18.37.34 --hostname=i100.uppmax.uu.se" >> /tmp/pre_install_network_config # Enable installation monitoring vgreduce -v --removemissing --force vg_local vgreduce --removemissing --force vg_local hwraid=0 if [ $hwraid -eq 1 ]; then cat >> /tmp/pre_partitiontable << PARTTABLE_DONE zerombr clearpart --all --initlabel --drives=sda part /boot --fstype ext3 --size=131072 --asprimary --ondisk=sda part pv.01 --size=16 --grow --ondisk=sda volgroup vg_local pv.01 logvol / --fstype ext4 --vgname=vg_local --name=root --size=32768 logvol swap --fstype swap --name=swap --vgname=vg_local --name=swap --size=8192 logvol /scratch --fstype ext4 --vgname=vg_local --name=scratch --size=1 --grow PARTTABLE_DONE else cat >> /tmp/pre_partitiontable << PARTTABLE_DONE zerombr clearpart --all --drives=sda,sdb,sdc,sdd part raid.01 --size=2048 --ondisk=sda --asprimary part raid.02 --size=2048 --ondisk=sdb --asprimary part raid.03 --size=2048 --ondisk=sdc --asprimary part raid.04 --size=2048 --ondisk=sdd --asprimary #part raid.11 --size=65536 --grow --ondisk=sda #part raid.12 --size=65536 --grow --ondisk=sdb #part raid.13 --size=65536 --grow --ondisk=sdc #part raid.14 --size=65536 --grow --ondisk=sdd part pv.01 --size 1 --grow --ondisk sda --asprimary # Setup lvm raid later in installation part None --size 1 --grow --ondisk sdb --asprimary part None --size 1 --grow --ondisk sdc --asprimary part None --size 1 --grow --ondisk sdd --asprimary raid /boot --fstype ext3 --level=1 --device=md0 raid.01 raid.02 raid.03 raid.04 #raid pv.01 --level=0 --device=md1 raid.11 raid.12 raid.13 raid.14 volgroup vg_local pv.01 logvol / --fstype ext4 --vgname=vg_local --name=root --size=20480 logvol swap --fstype swap --name=swap --vgname=vg_local --name=swap --size=8192 logvol /scratch --fstype ext4 --fsoptions=defaults,noatime,nodiratime,user_xattr,acl --vgname=vg_local --name=scratch --size=1 --grow PARTTABLE_DONE fi chvt 3 %end %packages net-tools bind-utils less wget kernel-devel kernel-headers centos-release traceroute sysstat strace %end %post set -x -v exec 1>/root/ks-post.log 2>&1 # Activate debugging from here ... # so you can see what is happening while installation runs exec >/root/ks-post-anaconda.log 2>&1 #tail -f /root/ks-post-anaconda.log >/dev/tty3 & tail -f /root/ks-post-anaconda.log | fold -w 80 -s >/dev/console & chvt 3 echo "# Running Post Configuration #" service network restart sleep 10 nslookup ftp.scientificlinux.org ping -c 5 ftp.scientificlinux.org traceroute ftp.scientificlinux.org ping -c 5 cobbler.uppmax.uu.se sleep 10 # Remove all sl6 repo files, only use repos that cobbler gives us rm -f /etc/yum.repos.d/* yum clean all echo "======================================================> a" # Start yum configuration # do NOT remove this. It is needed by cobbler to setup repos curl "http://172.18.37.100/cblr/svc/op/yum/system/i100" --output /etc/yum.repos.d/cobbler-config.repo # End yum configuration echo "======================================================> b" cat < /etc/sysconfig/network-scripts/ifcfg-eno1 TYPE=Ethernet BOOTPROTO=static DEVICE=eno1 NAME=eno1 HWADDR=0c:c4:7a:4d:7f:5e ONBOOT=yes IPADDR=172.18.13.100 NETMASK=255.255.252.0 GATEWAY=172.18.12.1 DEFROUTE=yes IPV6INIT=yes IPV6_AUTOCONF=no IPV6ADDR=2001:6b0:b:aa06::100a/64 IPV6_DEFAULTGW=2001:6b0:b:aa06::fff NM_CONTROLLED=no EOF cat < /etc/sysconfig/network-scripts/ifcfg-eno2 TYPE=Ethernet BOOTPROTO=none DEVICE=eno2 NAME=eno2 ONBOOT=no IPV6INIT=no IPV6_AUTOCONF=no NM_CONTROLLED=no EOF echo "======================================================> c" # Start download cobbler managed config files (if applicable) # End download cobbler managed config files (if applicable) echo "======================================================> d" # Begin cobbler registration # skipping for system-based installation # End cobbler registration echo "======================================================> e" echo "======================================================> f" exec > /root/ks-post-UPPMAX.log 2>&1 tail -f /root/ks-post-UPPMAX.log | fold -w 80 -s >/dev/console & echo "======================================================> g" parted -s /dev/sdb set 2 lvm on parted -s /dev/sdc set 2 lvm on parted -s /dev/sdd set 2 lvm on pvcreate -f /dev/sdb2 pvcreate -f /dev/sdc2 pvcreate -f /dev/sdd2 vgextend vg_local /dev/sdb2 /dev/sdc2 /dev/sdd2 lvconvert -m1 --mirrorlog disk vg_local/root lvconvert -m1 --mirrorlog disk vg_local/swap umount /scratch lvremove -y vg_local/scratch lvcreate -y -l98%FREE --stripesize 64K --stripes 4 -n scratch vg_local #Martin testar utan thinpool 2017-03-15. See irma.save1 for original #lvcreate -V 3617100M --thin -n scratch vg_local/thinpool mkfs.ext4 -m0 -L scratch -b 4096 -E stride=16,stripe-width=64 -O dir_index,extent,large_file /dev/vg_local/scratch mount /scratch if [ -f /etc/debian_version ]; then apt-get -y install puppet puppet agent --enable else yum -y install puppet fi cat > /etc/puppet/puppet.conf << PUPPETCONF [main] # The Puppet log directory. # The default value is '$vardir/log'. logdir = /var/log/puppet # Where Puppet PID files are kept. # The default value is '$vardir/run'. rundir = /var/run/puppet # Where SSL certificates are kept. # The default value is '$confdir/ssl'. ssldir = $vardir/ssl [agent] server = puppet.uppmax.uu.se # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` # option. # The default value is '$confdir/classes.txt'. classfile = $vardir/classes.txt # Where puppetd caches the local configuration. An # extension indicating the cache format is added automatically. # The default value is '$confdir/localconfig'. localconfig = $vardir/localconfig PUPPETCONF # Enable puppet service /usr/bin/puppet apply -e 'service { "puppet": enable => true, } ' # Install puppet ssh module puppet agent -tv --tags ssh puppet agent -tv --tags yum yum clean all yum -y update --exclude=kernel* puppet agent -tv --tags ldap-client #latest prefered kernel kern='3.10.0-229.14.1.el7' # Try to do all infiniband stuff first so that the ib module loads correctly in initramfs puppet agent -tv --tags ib # Install latest lustre kernel #yum -y --disableexcludes=all install kernel-devel-$latestlustrekern kernel-headers-$latestlustrekern kernel-firmware-$latestlustrekern #yum -y --disableexcludes=all install kernel-$latestlustrekern #depmod $latestlustrekern.x86_64 # Install prefered kernel yum -y --disableexcludes=all install kernel-devel-$kern kernel-headers-$kern kernel-firmware-$kern yum -y --disableexcludes=all install kernel-$kern # If kernel-devel was installed before then we need to use yum update yum -y --disableexcludes=all upgrade kernel-devel-$kern depmod $kern.x86_64 # Make sure that we are booting from the prefered kernel grubby --set-default=/boot/vmlinuz-$kern.x86_64 puppet agent -tv --tags ntp-client cat < /etc/sysconfig/network-scripts/ifcfg-eno1 TYPE=Ethernet BOOTPROTO=static DEVICE=eno1 NAME=eno1 HWADDR=0c:c4:7a:4d:7f:5e ONBOOT=yes IPADDR=172.18.13.100 NETMASK=255.255.252.0 GATEWAY=172.18.12.1 DEFROUTE=yes IPV6INIT=yes IPV6_AUTOCONF=no IPV6ADDR=2001:6b0:b:aa06::100a/64 IPV6_DEFAULTGW=2001:6b0:b:aa06::fff NM_CONTROLLED=no EOF cat < /etc/sysconfig/network-scripts/ifcfg-eno2 TYPE=Ethernet BOOTPROTO=none DEVICE=eno2 NAME=eno2 ONBOOT=no IPV6INIT=no IPV6_AUTOCONF=no NM_CONTROLLED=no EOF echo "======================================================> j" chvt 1 # Enable post-install boot notification # Start final steps curl "http://172.18.37.100/cblr/svc/op/ks/system/i100" -o /root/cobbler.ks curl "http://172.18.37.100/cblr/svc/op/trig/mode/post/system/i100" -o /dev/null curl "http://172.18.37.100/cblr/svc/op/nopxe/system/i100" -o /dev/null # End final steps %end