Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install
- url --url http://centos.mirror/centos/7.5.1804/os/x86_64 --proxy=http://172.21.99.4:8080
- lang en_US.UTF-8
- selinux --enforcing
- keyboard us
- skipx
- # check if virtual to determine interface names
- network --device ens192 --bootproto dhcp --hostname cody-pirone.ffm --device=00:50:56:8e:c4:16
- 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
- rootpw --iscrypted conjomapangpang
- firewall --service=ssh
- authconfig --useshadow --passalgo=SHA256 --kickstart
- timezone --utc UTC
- services --disabled gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd
- bootloader --location=mbr --append="nofb quiet splash=quiet"
- #Dynamic - this line tells Foreman this is a script rather then a static layout
- #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
- #or will create a swap partition with your memory size + 2GB.
- #get the actual memory installed on the system and divide by 1024 to get it in MB
- act_mem=$((`grep MemTotal: /proc/meminfo | sed 's/^MemTotal: *//'|sed 's/ .*//'` / 1024))
- #act_mem="32768"
- #check if the memory is less than 2GB then swap is double the memory else it is memory plus 2 GB
- #if [ "$act_mem" -gt 2048 ]; then
- # vir_mem=$(($act_mem / 100 * 20))
- #else
- # vir_mem=$(($act_mem * 2))
- #fi
- # use 20% of RAM as Swap
- vir_mem=$(($act_mem / 100 * 20))
- #vir_mem=6540
- #copy all the HDD partitions to the temp file for execution
- #ignoredisk --only-use=sda
- cat <<EOF > /tmp/diskpart.cfg
- zerombr
- clearpart --all --initlabel
- part /boot --fstype ext4 --size 512 --asprimary
- #part swap --size "$vir_mem"
- part pv.01 --size=1 --grow --ondisk=sda
- volgroup vg00 pv.01
- logvol / --name=lv_root --vgname=vg00 --fstype=ext4 --size=2048 --grow
- logvol swap --name=lv_swap --vgname=vg00 --fstype=swap --size=$vir_mem
- #logvol swap --name=lv_swap --vgname=vg00 --fstype=swap --size=6540
- EOF
- text
- reboot
- %packages
- yum
- dhclient
- ntp
- wget
- @Core
- redhat-lsb-core
- %end
- %post --nochroot
- exec < /dev/tty3 > /dev/tty3
- #changing to VT 3 so that we can see whats going on....
- /usr/bin/chvt 3
- (
- cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
- /usr/bin/chvt 1
- ) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
- %end
- %post
- logger "Starting anaconda cody-pirone.ffm.vwd.cloud postinstall"
- exec < /dev/tty3 > /dev/tty3
- #changing to VT 3 so that we can see whats going on....
- /usr/bin/chvt 3
- (
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement