Advertisement
Guest User

correct_via116

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