#platform=x86, AMD64, or Intel EM64T #key --skip # System authorization information auth --useshadow --passalgo=sha512 # System bootloader configuration #bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information #clearpart --linux --initlabel --drives=sda # Use text mode install text # Firewall configuration #firewall --enabled --ssh --trust=eth0 # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US.utf8 # Installation logging level logging --level=info # Use network installation #cdrom #harddrive --dir=/ --partition=sdc url --url=http://rtihardware.homelinux.com/rhel7.7_64_daisy_efi/ # Network information network --bootproto=dhcp --device=eth0 --onboot=on # Reboot after installation #reboot #Root password rootpw --iscrypted $1$b2bDwXkz$ZpKi4Jx7tox779nrUdt8h1 user --groups=wheel,tty,screen,video,utmp --name=tfsupport --password=$6$TGmj4wdvE9TYocem$G6eYJWyLophRmYkvNp37iUU0P8NomMrhR0kSgCJFbduQc41nhaOFneUUDU0lp99sz9dnfOVoAIhRfuIyqnhGc/ --iscrypted # SELinux configuration selinux --permissive # Do not configure the X Window System skipx # System timezone timezone America/Chicago # Install OS instead of upgrade install # Disk partitioning information %include /tmp/fslayout %packages @Base samba cups minicom elinks telnet mc glibc mutt samba-client slang curl sendmail glibc.i686 strace dvd+rw-tools dialog firstboot mtools cdrecord fetchmail net-snmp vlock sysstat ntp procps e2fsprogs audit expect ksh nmap uuid libuuid screen dos2unix unix2dos yum-presto ncurses-term boost biosdevname iptables-services perl-Digest perl-Digest-MD5 -chrony %end %pre DEVICE="" find_passport () { passport_device="" dev_names=(sda sdb sdc sdd sde) for thisdev in ${dev_names[@]} do # WD (Western Digital) is the vendor found=0 vendor_file="/sys/block/$thisdev/device/vendor" if [ -f $vendor_file ] then exec < $vendor_file while read line do if [[ $line =~ "WD" ]] then found=1 break fi done fi if [ $found -eq 0 ] then continue fi # ... AND Model is correct. # Note it is important to look at the model. Some shops # could have internal Western digital HDDs. If we were # to only look for "WD" drive, and not look for this particular # model, then, we could inadvertently use the "real" device # as the "backup" device, which would be catastrophic. model_file="/sys/block/$thisdev/device/model" if [ -f $model_file ] then exec < $model_file while read line do if [[ $line =~ "My Passport" ]] then found=1 break fi done fi if [ $found -eq 0 ] then continue fi # found a match passport_device="/dev/$thisdev" break done DEVICE=$passport_device } if [ -d "/sys/block" ] then find_passport fi if [ $DEVICE = "/dev/sda" -o \ $DEVICE = "/dev/sdb" -o \ $DEVICE = "/dev/sdc" -o \ $DEVICE = "/dev/sdd" -o \ $DEVICE = "/dev/sde" ] then # use separate virtual console for output VCON=3 exec < /dev/tty$VCON > /dev/tty$VCON 2>/dev/tty$VCON chvt $VCON echo echo "**********************************************************" echo 'Starting Teleflora Kickstart $Revision: 1.18 $' echo "**********************************************************" echo echo echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!" echo "!!!! ERROR! Passport Drive is plugged in as device $DEVICE." echo "!!!! Since the assumption is that the passport drive contains" echo "!!!! backup data and that data could be destroyed by the" echo "!!!! installation, the installation will not proceed." echo "!!!!" echo "!!!! Please unplug the Western Digital Passport device and" echo "!!!! then re-try this kickstart." echo "!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo echo echo "Sleeping for 10 seconds... and then rebooting." echo sleep 10 reboot fi # Partition Layout.... #set $(list-harddrives) #let numd=$#/2 #d1=$1 #d2=$3 #if [ ! -z $d2 ] #then # insert raid filesystem partitions # echo "clearpart --all --initlabel --drives=sda,sdb">/tmp/fslayout # echo "bootloader --location=mbr --driveorder=sda,sdb">>/tmp/fslayout # echo "part raid.01 --ondisk=sda --asprimary --size=30000">>/tmp/fslayout # echo "part raid.11 --ondisk=sda --asprimary --size=100 --grow">>/tmp/fslayout # echo "part swap --ondisk=sda --asprimary --recommended">>/tmp/fslayout # echo "">>/tmp/fslayout # echo "part raid.02 --ondisk=sdb --asprimary --size=30000">>/tmp/fslayout # echo "part raid.12 --ondisk=sdb --asprimary --size=100 --grow">>/tmp/fslayout # echo "part swap --ondisk=sdb --asprimary --recommended">>/tmp/fslayout # echo "">>/tmp/fslayout # echo "">>/tmp/fslayout # echo "raid / --level=RAID1 --device=md0 --fstype=xfs raid.01 raid.02">>/tmp/fslayout # echo "raid /teleflora --level=RAID1 --device=md1 --fstype=xfs raid.11 raid.12">>/tmp/fslayout # CDROM="/dev/sdc1" #else # insert non-raid partitions echo "clearpart --all --initlabel --drives=sda">/tmp/fslayout echo "bootloader --location=mbr --driveorder=sda --append=nomodeset biosdevname=0 net.ifnames=0 video=640x480">>/tmp/fslayout # echo "bootloader --location=mbr --driveorder=sda">>/tmp/fslayout echo "part biosboot --fstype=biosboot --size=1 --ondisk=sda">>/tmp/fslayout echo "part /boot/efi --ondisk=sda --asprimary --fstype=efi --size=200">>/tmp/fslayout echo "part / --ondisk=sda --asprimary --fstype=xfs --size=30000">>/tmp/fslayout echo "part /teleflora --ondisk=sda --asprimary --fstype=xfs --size=100 --grow">>/tmp/fslayout echo "part swap --ondisk=sda --asprimary --recommended">>/tmp/fslayout # CDROM="/dev/sdb1" #fi %end %post cat << xxxEOFxxx > /tmp/ksrti.sh #!/bin/bash LOG="/tmp/ksrti.sh.log" /tmp/ksrti_install.sh \$1 \$2 \$3 \$4 \$5 2>&1 | tee -a \$LOG xxxEOFxxx cat << xxxEOFxxx > /tmp/ksrti_install.sh #!/bin/bash # Script to run, just after a kickstart, which will start things rolling. CDROM="/dev/sr0" if [ \$# -eq 0 ]; then echo "Below is the usage info. Please note only the hostname is required." echo "Usage ksrti.sh {hostname} {ipaddr} {dnsaddr} {gateway} {netmask}" exit 1 fi if [ "\$2" == "" ]; then new_ip="192.168.1.21" else new_ip="\$2" fi if [ "\$3" == "" ]; then new_dns="192.168.1.1" else new_dns="\$3" fi if [ "\$4" == "" ]; then new_gateway="192.168.1.1" else new_gateway="\$4" fi if [ "\$5" == "" ]; then new_netmask="255.255.255.0" else new_netmask="\$5" fi ping -c 5 google.com if [ \$? -eq 0 ]; then echo "Internet connection working.....continuing" else echo "Internet connection down.....exiting" exit 1 fi echo "\`date\` -- Beginning RTI Install \${1}.teleflora.com" >/tmp/verify.txt cd /tmp wget http://rtihardware.homelinux.com/ostools/ostools-1.15-latest.tar.gz tar xvfz ostools-1.15-latest.tar.gz ./bin/install-ostools.pl ./ostools-1.15-latest.tar.gz /teleflora/ostools/bin/updateos.pl --ipaddr="\$new_ip" --gateway="\$new_gateway" --netmask="\$new_netmask" --hostname=\$1 service network restart /teleflora/ostools/bin/updateos.pl --nameserver="\$new_dns" ping -c 5 google.com if [ \$? -eq 0 ]; then echo "Internet connection working.....continuing" else echo "Internet connection down.....exiting" exit 1 fi systemctl disable firewalld systemctl enable iptables yum -y remove firewalld /teleflora/ostools/bin/harden_linux.pl --iptables echo "Downloading files. This will take a bit....." cd /tmp wget http://rtihardware.homelinux.com/t1800/2145830.jar.gz wget http://rtihardware.homelinux.com/t1800/jdk-8u65-linux-x64.tar.gz wget http://rtihardware.homelinux.com/t1800/RTI-16.1.5-Linux.iso.gz wget http://rtihardware.homelinux.com/t1800/update_bbj_15.pl wget http://rtihardware.homelinux.com/t1800/14_rhel6.tar.gz wget http://rtihardware.homelinux.com/t1800/tfsupport-authorized_keys wget http://rtihardware.homelinux.com/t1800/twofactor-20090723.tar wget http://rtihardware.homelinux.com/t1800/multiserver.pwd echo "Done Downloading files...." echo "Extracting files...." tar xvfz /tmp/14_rhel6.tar.gz gunzip /tmp/RTI-16.1.5-Linux.iso.gz /teleflora/ostools/bin/updateos.pl --baremetal #/teleflora/ostools/bin/updateos.pl --ospatches /teleflora/ostools/bin/updateos.pl --rti14 service blm start sleep 3 ps -ef | grep basis echo ; echo ; echo echo "Make sure that you see the -T above and Press enter to continue" read X mkdir /usr2/bbx mkdir /usr2/bbx/bin ln -s /usr2/ostools/bin/rtiuser.pl /usr2/bbx/bin/rtiuser.pl echo "bbj 8 installed......" service blm start service bbj start echo "Installing RTI...." mount -o loop /tmp/RTI-16.1.5-Linux.iso /mnt cd /mnt ./install_rti-16.1.5.pl --nobbxt /usr2/bbx /teleflora/ostools/bin/updateos.pl --samba-set-passdb umount /mnt cd /tmp echo "Installing bbj 15......" chmod +x /tmp/update_bbj_15.pl /tmp/update_bbj_15.pl --bbj15 echo "Fixing init.d service files....." sed -i '1s/^/#Required-Start:\ \$network\n/' /etc/init.d/blm sed -i '1s/^/#Required-Start:\ blm\ \$network\n/' /etc/init.d/bbj sed -i '1s/^/#\!\/bin\/sh\n/' /etc/init.d/blm sed -i '1s/^/#\!\/bin\/sh\n/' /etc/init.d/bbj echo "Installing RTI Florist Directory...." wget http://tposlinux.blob.core.windows.net/rti-edir/rti-edir-tel-latest.patch wget http://tposlinux.blob.core.windows.net/rti-edir/applypatch.pl ./applypatch.pl ./rti-edir-tel-latest.patch echo "Installing tfsupport authorized keys...." mkdir /home/tfsupport/.ssh chmod 700 /home/tfsupport/.ssh chown tfsupport:rti /home/tfsupport/.ssh tar xvf /tmp/twofactor-20090723.tar chmod +x /tmp/*.pl cp /tmp/tfsupport-authorized_keys /home/tfsupport/.ssh/authorized_keys chmod 700 /home/tfsupport/.ssh/authorized_keys chown tfsupport:root /home/tfsupport/.ssh/authorized_keys echo "Installing admin menus....." /tmp/install_adminmenus.pl --run echo "Installing Dell dset...." gunzip /tmp/delldset_v2.0.0.119_A00.bin.gz /tmp/dset.sh rm -f /etc/cron.d/nightly-backup rm -f /tmp/rtibackup.pl cd /tmp ./bin/install-ostools.pl ./ostools-1.15-latest.tar.gz echo "Installing the backups.config file to exclude files during restore...." wget http://rtihardware.homelinux.com/ostools/backups.config.rhel7 cp /usr2/bbx/config/backups.config /usr2/bbx/config/backups.config.save cp backups.config.rhel7 /usr2/bbx/config/backups.config chmod 777 /usr2/bbx/config/backups.config chown tfsupport:rtiadmins /usr2/bbx/config/backups.config wget http://rtihardware.homelinux.com/ostools/librxtxSerial.so echo "Installing 32-bit library for serial ports...." cp /usr2/basis/lib/librxtxSerial.so /usr2/basis/lib/librxtxSerial.so.64bit cp librxtxSerial.so /usr2/basis/lib/librxtxSerial.so chmod 666 /usr2/basis/lib/librxtxSerial.so chown root:root /usr2/basis/lib/librxtxSerial.so echo "Adding multiserver.pwd fix....." cp -f /tmp/multiserver.pwd /usr2/bbx/config/ # Install tcc echo "Installing tcc....." cd /usr2/bbx/bin wget http://rtihardware.homelinux.com/support/tcc/tcc-latest_linux.tar.gz tar xvfz ./tcc-latest_linux.tar.gz rm -f ./tcc rm -f ./tcc_tws ln -s ./tcc2_rhel7 ./tcc ln -s ./tcc_rhel7 ./tcc_tws cd /tmp echo "Done installing tcc..." echo "Installing Kaseya....." wget http://rtihardware.homelinux.com/support/KcsSetup.sh chmod +x /tmp/KcsSetup.sh /tmp/KcsSetup.sh /teleflora/ostools/bin/updateos.pl --ospatches echo "\`date\` -- End RTI Install \${1}.teleflora.com" >>/tmp/verify.txt # Verify /tmp/verify.sh echo "Remove the DVD from the drive" echo "Please reboot the system......ctl-alt-del" xxxEOFxxx cat << xxxEOFxxx > /tmp/dset.sh #!/usr/bin/expect spawn /tmp/delldset_v2.0.0.119_A00.bin expect "to proceed" send "q"; expect "of this license? (y/n):" send "y"; expect "to quit:" send "4" expect "new directory path:" send "\n"; expect "Create? (y/n):" send "y"; interact xxxEOFxxx if [[ ! -e /etc/profile.d/term.sh ]]; then cat << xxxEOFxxx > /etc/profile.d/term.sh unicode_stop xxxEOFxxx fi cat << xxxEOFxxx >> /tmp/verify.sh echo "--------------------">>/tmp/verify.txt echo "ifconfig results....">>/tmp/verify.txt ifconfig >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/hosts ....">>/tmp/verify.txt cat /etc/hosts >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/resolve.conf .....">>/tmp/verify.txt cat /etc/resolv.conf >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "netstat results....">>/tmp/verify.txt netstat -rn >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/samba/smb.conf .....">>/tmp/verify.txt cat /etc/samba/smb.conf >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "usr2/basis/basis.lic .....">>/tmp/verify.txt cat /usr2/basis/basis.lic >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "/etc/hosts.allow">>/tmp/verify.txt cat /etc/hosts.allow >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt mail -s \`hostname\` mgreen@teleflora.com,kpugh@teleflora.com,sjackson@teleflora.com /tmp/memoryinfo %end