Advertisement
Guest User

mixedupkickstart_via119

a guest
Oct 12th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1.  
  2.  
  3.  
  4. install
  5. url --url http://centos.mirror/centos/7.5.1804/os/x86_64 --proxy=http://172.21.99.4:8080
  6. lang en_US.UTF-8
  7. selinux --enforcing
  8. keyboard us
  9. skipx
  10.  
  11.  
  12. # check if virtual to determine interface names
  13.  
  14. network --device ens192 --bootproto dhcp --hostname cody-pirone.ffm --device=00:50:56:8e:c4:16
  15. network --device ens224 --bootproto static --ip=172.21.1.138 --netmask=255.255.255.0 --gateway=172.21.1.1 --nameserver=172.21.0.8,172.21.0.208 --hostname cody-pirone.ffm --device=00:50:56:8e:21:81
  16.  
  17.  
  18.  
  19.  
  20. rootpw --iscrypted conjomapangpang
  21. firewall --service=ssh
  22. authconfig --useshadow --passalgo=SHA256 --kickstart
  23. timezone --utc UTC
  24. services --disabled gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd
  25.  
  26.  
  27.  
  28.  
  29. bootloader --location=mbr --append="nofb quiet splash=quiet"
  30.  
  31.  
  32. #Dynamic - this line tells Foreman this is a script rather then a static layout
  33. #This snippets define the swap partition size, it would generate a partition twice the size of the memory if your physical memory is up to 2GB
  34. #or will create a swap partition with your memory size + 2GB.
  35.  
  36. #get the actual memory installed on the system and divide by 1024 to get it in MB
  37. act_mem=$((`grep MemTotal: /proc/meminfo | sed 's/^MemTotal: *//'|sed 's/ .*//'` / 1024))
  38. #act_mem="32768"
  39.  
  40. #check if the memory is less than 2GB then swap is double the memory else it is memory plus 2 GB
  41. #if [ "$act_mem" -gt 2048 ]; then
  42. # vir_mem=$(($act_mem / 100 * 20))
  43. #else
  44. # vir_mem=$(($act_mem * 2))
  45. #fi
  46.  
  47. # use 20% of RAM as Swap
  48. vir_mem=$(($act_mem / 100 * 20))
  49. #vir_mem=6540
  50.  
  51. #copy all the HDD partitions to the temp file for execution
  52. #ignoredisk --only-use=sda
  53. cat <<EOF > /tmp/diskpart.cfg
  54. zerombr
  55. clearpart --all --initlabel
  56. part /boot --fstype ext4 --size 512 --asprimary
  57. #part swap --size "$vir_mem"
  58. part pv.01 --size=1 --grow --ondisk=sda
  59. volgroup vg00 pv.01
  60. logvol / --name=lv_root --vgname=vg00 --fstype=ext4 --size=2048 --grow
  61. logvol swap --name=lv_swap --vgname=vg00 --fstype=swap --size=$vir_mem
  62. #logvol swap --name=lv_swap --vgname=vg00 --fstype=swap --size=6540
  63. EOF
  64.  
  65. text
  66. reboot
  67.  
  68. %packages
  69. yum
  70. dhclient
  71. ntp
  72. wget
  73. @Core
  74. redhat-lsb-core
  75.  
  76. %end
  77.  
  78. %post --nochroot
  79. exec < /dev/tty3 > /dev/tty3
  80. #changing to VT 3 so that we can see whats going on....
  81. /usr/bin/chvt 3
  82. (
  83. cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
  84. /usr/bin/chvt 1
  85. ) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
  86. %end
  87. %post
  88. logger "Starting anaconda cody-pirone.ffm.vwd.cloud postinstall"
  89. exec < /dev/tty3 > /dev/tty3
  90. #changing to VT 3 so that we can see whats going on....
  91. /usr/bin/chvt 3
  92. (
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement