Skip to content

Instantly share code, notes, and snippets.

@JosiahKerley
Last active January 20, 2017 21:07
Show Gist options
  • Save JosiahKerley/d0b21ed7d3792e26cb47276e41c3ad15 to your computer and use it in GitHub Desktop.
Save JosiahKerley/d0b21ed7d3792e26cb47276e41c3ad15 to your computer and use it in GitHub Desktop.
auth --enableshadow --passalgo=sha512
url --url=http://mirror.centos.org/centos/7/os/x86_64/
text
firstboot --enable
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
rootpw --iscrypted $1$changeme$Gc5uJM96SM5XUZNUcieKS/
services --enabled="chronyd"
timezone America/Denver --isUtc
reboot
## Networking
network --bootproto=dhcp --device=eno1 --ipv6=auto --activate
network --bootproto=dhcp --device=eno2 --ipv6=auto --activate
network --hostname=centos.khs.org
## Disks
bootloader --location=mbr
autopart --type=lvm
zerombr
clearpart --all
## Packages
%packages
@^minimal
@core
chrony
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
## Anaconda
%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 scripts<--##
%post
## Packages
for PKG in epel-release tmux htop iotop iftop vim nano emacs wget rsync git ansible python-pip mdadm smartmontools yum-utils sysbench
do
yum install -y ${PKG}
done
## Add password checker
cat > /etc/profile.d/passwdcheck.sh << 'BASH'
#!/bin/bash
if cat /etc/shadow | grep -E 'changeme'
then
echo 'CHANGE YOUR PASSWORD!!!'
sleep 5
echo 'run `echo YOURPASSWORDHERE|passwd --stdin`'
fi
function disk-health(){
cat /var/log/smart.status
}
BASH
## Done
yum update -y
package-cleanup --oldkernels --count=1
%end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment