Advertisement
fmartinelli

PXE_UEFI_kickstart.ks

Oct 15th, 2015
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.75 KB | None | 0 0
  1. # System authorization information
  2. auth --enableshadow --passalgo=sha512
  3.  
  4. # Use network installation
  5. url --url="http://linuxsoft.cern.ch/cern/centos/7/os/x86_64/"
  6.  
  7. # Use graphical install
  8. #graphical
  9.  
  10. # Run the Setup Agent on first boot
  11. firstboot --enable
  12. ignoredisk --only-use=sdy
  13. # Keyboard layouts
  14. keyboard --vckeymap=us --xlayouts='us'
  15. # System language
  16. lang en_US.UTF-8
  17.  
  18. # Network information
  19. network  --bootproto=dhcp --device=ens34 --ipv6=auto --activate
  20.  
  21. # Root password
  22. rootpw --iscrypted :):|:(
  23. # System timezone
  24. timezone Europe/Zurich --isUtc --isUtc --ntpservers=myntp01,myntp02
  25.  
  26. #text
  27. #skipx
  28.  
  29. # Partition clearing information
  30. clearpart --all --initlabel --drives=sdy
  31.  
  32. #%include /tmp/ks-partition.cfg
  33. # Disk partitioning information
  34. part /boot/efi --fstype=efi --grow --maxsize=200 --size=20   # <-------- BIG NEWS !!!
  35. #
  36. # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html#sect-bootloader-x86
  37. # UEFI systems
  38. # Only GPT is allowed on UEFI systems. In order to install on a formatted disk with a MBR, you must first reformat it.
  39. # You need to create an EFI System Partition (/boot/efi), regardless of the partitioning scheme. The /boot/efi partition should be at least 50 MB in size; its recommended size is 200 MB.
  40. #
  41. part /        --fstype="xfs"  --ondisk=sdy --size=9536 --label=/
  42. part /boot    --fstype="xfs"  --ondisk=sdy --size=1200 --label=/boot
  43. part swap     --fstype="swap" --ondisk=sdy --size=10000
  44. part /var     --fstype="xfs"  --ondisk=sdy --size=20000 --label=/var
  45. part /var/log --fstype="xfs"  --ondisk=sdy --size=25000 --label=/var/log
  46. part /var/log/audit   --fstype="xfs"  --ondisk=sdy                     --size=2000 --label=/var/log/audit
  47. part /usr/vice/cache  --fstype="xfs"  --fsoptions="nodev,async,noatime" --size=10000 --ondisk=sdy --grow --label=/usr/vice/cache
  48. part /tmp  --label=/tmp   --fstype="xfs"  --size=10000  --fsoptions="nodev,async,nosuid,noexec"    --ondisk=sdy
  49.  
  50. bootloader --location=mbr # On a GPT-formatted disk, this option installs stage 1.5 of the boot loader into the BIOS boot partition.
  51.  
  52. reboot
  53.  
  54. %packages --ignoremissing
  55. @core
  56. @system-admin-tools
  57. @hardware-monitoring
  58. @emacs
  59. @network-file-system-client
  60. augeas-libs
  61. authconfig-gtk
  62. autogen-libopts
  63. bc
  64. createrepo
  65. curl
  66. dstat
  67. elinks
  68. git
  69. htop
  70. iftop
  71. kexec-tools
  72. krb5-workstation
  73. libselinux-ruby
  74. libyaml
  75. lsof
  76. mlocate
  77. net-tools
  78. nss-pam-ldapd
  79. ntp
  80. ntpdate
  81. ossec-hids-client
  82. pciutils
  83. openafs
  84. kmod-openafs
  85. openafs-client
  86. openafs-krb5
  87. openafs-authlibs
  88. krb5-workstation
  89. puppet
  90. python-sssdconfig
  91. ruby
  92. ruby-irb
  93. ruby-libs
  94. rubygem-bigdecimal
  95. rubygem-io-console
  96. rubygem-json
  97. rubygem-psych
  98. rubygem-rdoc
  99. rubygems
  100. salt-minion
  101. sssd-client
  102. sssd-ldap
  103. sssd-proxy
  104. strace
  105. vim
  106. wget
  107. yum-plugin-priorities
  108. yum-plugin-ps
  109. -bind
  110. -cern-linuxsupport-access
  111. -dovecot
  112. -glusterfs
  113. -httpd
  114. -iwl100-firmware
  115. -iwl1000-firmware
  116. -iwl105-firmware
  117. -iwl135-firmware
  118. -iwl2000-firmware
  119. -iwl2030-firmware
  120. -iwl3160-firmware
  121. -iwl3945-firmware
  122. -iwl4965-firmware
  123. -iwl5000-firmware
  124. -iwl5150-firmware
  125. -iwl6000-firmware
  126. -iwl6000g2a-firmware
  127. -iwl6000g2b-firmware
  128. -iwl6050-firmware
  129. -iwl7260-firmware
  130. -net-snmp
  131. -ocsinventory-agent
  132. -rsh
  133. -rsh-server
  134. -samba
  135. -squid
  136. -talk
  137. -talk-server
  138. -telnet
  139. -telnet-server
  140. -tftp
  141. -vsftpd
  142. -xinetd
  143. -ypbind
  144. -ypserv
  145. %end
  146.  
  147.  
  148. %addon com_redhat_kdump --enable --reserve-mb='auto'
  149. %end
  150.  
  151.  
  152. %pre --interpreter=/usr/bin/bash --log=/tmp/pre.log
  153. echo "### Begin of %pre"
  154. cat /proc/cmdline
  155. echo "### End   of %pre"
  156. %end
  157.  
  158. %post --nochroot --interpreter=/usr/bin/bash --log=/mnt/sysimage/var/log/post_nochroot.log
  159. echo "### Begin of %post --nochroot"
  160. [ -f /tmp/pre.log ] && mv /tmp/pre.log /mnt/sysimage/var/log/
  161. # cat /mnt/sysimage/var/log/pre.log
  162. # ### Begin of %pre
  163. # initrd=scientific/71/x86_64/initrd.img inst.repo=http://linuxsoft.cern.ch/cern/centos/7/os/x86_64/ inst.sshd inst.text inst.loglevel=debug inst.syslog=t3service01.psi.ch:1514
  164. # ks=http://linux.web.psi.ch/kickstart/configs/centos71-t3.ks BOOT_IMAGE=scientific/71/x86_64/vmlinuz a=b c=d f=hhhh
  165. # ### End   of %pre
  166. # egrep -o c=[a-zA-Z]* pre.log
  167. # c=d
  168.  
  169. echo "### End   of %post --nochroot"
  170. %end
  171.  
  172. %post            --interpreter=/usr/bin/bash --log=/var/log/post.log
  173. echo "### Begin of %post"
  174. [ -f /etc/yum.repos.d/epel.repo ] && sed -i 's/^enabled=1$/enabled=0/' /etc/yum.repos.d/epel.repo
  175.  
  176. mkdir -p /usr/vice/etc/
  177. echo mycell > /usr/vice/etc/ThisCell
  178.  
  179. systemctl enable openafs-client
  180. systemctl status openafs-client
  181. systemctl start openafs-client
  182.  
  183.  
  184.  
  185. ######### T3 facts
  186. mkdir -p /etc/facter/facts.d
  187. cat << EOF >                       /etc/facter/facts.d/psi
  188. #!/bin/bash
  189. EOF
  190. # see %post --nochroot section
  191. cd /var/log/
  192. egrep -o zone=[a-zA-Z1-9]* pre.log | awk '{ print "echo "$1 }' >> /etc/facter/facts.d/psi
  193. egrep -o role=[a-zA-Z1-9]* pre.log | awk '{ print "echo "$1 }' >> /etc/facter/facts.d/psi
  194. egrep -o  set=[a-zA-Z1-9]* pre.log | awk '{ print "echo "$1 }' >> /etc/facter/facts.d/psi
  195. chmod ugo+x,ugo-w                                                 /etc/facter/facts.d/psi  
  196. cd -
  197. #####################
  198.  
  199. # CIS pag 53 https://benchmarks.cisecurity.org/downloads/form/index.cfm?download=rhel7.100
  200. cd /usr/lib/systemd/system/ && rm -f default.target && ln -s multi-user.target default.target && cd  -
  201.  
  202.  
  203.  
  204.  
  205. systemctl enable  ntpd
  206. systemctl restart ntpd
  207.  
  208.  
  209.  
  210.  
  211. cat << EOF > /etc/modprobe.d/CIS.conf
  212. install cramfs /bin/true
  213. install freevxfs /bin/true
  214. install jffs2 /bin/true
  215. install hfs /bin/true
  216. install hfsplus /bin/true
  217. install squashfs /bin/true
  218. install udf /bin/true
  219. install dccp /bin/true
  220. install sctp /bin/true
  221. install rds /bin/true
  222. install tipc /bin/true
  223. EOF
  224.  
  225. yum install puppet -y
  226. yum -y update
  227.  
  228. echo "### End of %post"
  229. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement