Skip to content

Instantly share code, notes, and snippets.

@aelkz
Last active June 15, 2018 12:05
Show Gist options
  • Save aelkz/d23e4d8f1785aa54d3bdd394b7a29ebb to your computer and use it in GitHub Desktop.
Save aelkz/d23e4d8f1785aa54d3bdd394b7a29ebb to your computer and use it in GitHub Desktop.
[RHEL7.3] KICKSTART ANACONDA CONFIGURATION (SSH) KVM 12GB
#version=RHEL7
#platform x86, AMD64, or Intel EM64T
# Use graphical install
graphical
#cmdline
# X Window System configuration information
xconfig --startxonboot
# System language and keyboard layout
lang en_US.UTF-8
keyboard us
timezone America/Sao_Paulo --isUtc --nontp
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage
# System authorization information
# user: root
# pwd.: admin12345
auth --passalgo=sha512 --useshadow
rootpw --iscrypted $6$D1vGxIly32NpFZ7k$judD8zn9CRdtz7.M0Kb2Ll7dHipJYUaZK54S1FDsz9YGyJcobU4vW5JZl6pjR7Q7N78DjuIeEPO2ajH9kUapP1
# to generate a new password:
# # dnf install makepasswd
# $ makepasswd -e sha512 -i 100 -n 3 <<< admin12345
group --name=common
user --groups=common --name=student --iscrypted --gecos="student" --password=$6$qG21QNh1nF2ac1Q4$x79JAjnUtLQyxdBFKOvNA4umPyEuHcDSclHdgBHv3D4ggzITlFKqqK8gj1NJwiQsMRuJHEuEN/3Zq4brTSIBf.
# Use CDROM installation media
cdrom
# ALTERNATIVE: nfs --server=192.168.122.1 --dir=/inst
# ALTERNATIVE: url --url http://192.168.122.1/inst
# ALTERNATIVE: url --url ftp://192.168.122.1/pub/inst
# ALTERNATIVE: harddrive --partition=/dev/sda10 --dir=/tmp/michael/
bootloader --append="crashkernel=auto" --location=mbr --boot-drive=vda
# Disk partitioning information
# pesize correspond to physicial extent size (kB)
ignoredisk --only-use=vda
clearpart --none --initlabel
## 12GB TOTAL
part pv.01 --fstype="lvmpv" --ondisk=vda --size=9232
part /boot --fstype="xfs" --ondisk=vda --size=2048
volgroup volgroup00 --pesize=4096 pv.01
logvol / --fstype="xfs" --size=6144 --name=logvol01 --vgname=volgroup00
logvol /home --fstype="xfs" --size=2048 --name=logvol02 --vgname=volgroup00
logvol swap --fstype="swap" --size=1024 --name=logvol00 --vgname=volgroup00
# Network information
# ALTERNATIVE:
# network --bootproto static --device=eth0 --gateway=192.168.122.1 --ip=192.168.122.150 --netmask=255.255.255.0 --noipv6 --nameserver==192.168.122.1 --activate
network --bootproto=dhcp --device=eth0 --noipv6 --activate
network --hostname=server1kvm.rhel.com
# System services
services --disabled="chronyd"
# SELinux Configuration
selinux --enforcing
firewall --enabled --http --ftp --smtp --ssh --port=9990,8989,9000,8080,8090,4220,4200
# Run the Setup Agent on first boot
firstboot --enable
%packages
@debugging
@java-platform
@console-internet
@network-tools
@base
@core
@security-tools
@dns-server
@fonts
@guest-agents
@guest-desktop-agents
@input-methods
glibc-utils
-abrt-addon-ccpp
-crash
-abrt-cli
-crash-gcore-command
-crash-trace-command
-abrt-addon-python
system-switch-java
lftp
elinks
mutt
whois
%end
%anaconda
pwpolicy root --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=50 --notstrict --nochanges --notempty
pwpolicy luks --minlen=6 --minquality=50 --notstrict --nochanges --notempty
%end
%post
# :: download java
# :: download scala
# :: download nodejs
# :: download typescript
# :: download sbt
# :: download apache-spark
# :: download apache-ant
# :: download apache-maven
# :: download apache-tomcat
# :: download git
# :: download gitkraken
# :: download sublime text
# :: download jboss-eap
# :: download libreoffice
# :: download ruby
# :: download virt-manager
# :: download virtual-box
# :: download docker
# :: download vagrant
# :: download spotify
# :: download slack
# :: download filezilla
# :: download intellij-idea
# :: download visual-studio-code
# :: download kripta
# :: download k3b
# :: download transmission
%end
reboot
# ------------------------------
# To test this file run:
# ksvalidator {this-file}.ks
# ------------------------------
# ------------------------------
# How to use this file
# ------------------------------
# At the Red Hat installation menu, highlight the first option and press TAB.
# It will display the startup directives toward the bottom of the screen.
#
# At the end of that line, add the following directive:
# ks=ftp://192.168.122.1/pub/ks.cfg (example)
#
# (ff the kickstart file is on a different server or on local media, substitute accordingly)
#
# If you want to debug the whole operation you can add the following directive at the end:
# rd.debug
# ------------------------------
# Troubleshooting
# ------------------------------
# Issue: kickstart file /run/install/ks.cfg is missing
# 1- I resolved it just now, it is because my VMWare NAT Service was closed, we have to make
# sure that VMWare connected to host, so it can get ks.cfg from host.
#
# 2- Copy your ks.cfg into the root of your iso.
# Then, modify your boot.cfg and add the entry ks=cdrom:/ks.cfg, where ks.cfg is your custom kickstart, after the kernelopt=runweasel line, i.e.
# kernelopt=runweasel ks=cdrom:/ks.cfg
# Then, save changes to your iso and boot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment