#version=DEVEL
# X Window System configuration information
xconfig  --startxonboot
# Use network installation
url --url="http://ge.mirror.cloud9.ge/centos/7.3.1611/os/x86_64/"
# License agreement
eula --agreed
# System authorization information
auth --enableshadow --passalgo=sha512
# Use graphical install
graphical
# Run the Setup Agent on first boot
selinux --disabled
firewall --disabled
firstboot --disable
# System services
services --enabled="chronyd"
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us','ge' --switch='grp:alt_shift_toggle'
# System language
lang en_US.UTF-8

ignoredisk --only-use=sda
# Network information
network  --bootproto=dhcp --device=enp0s3 --ipv6=off --activate
network  --bootproto=dhcp

# Root password
rootpw --iscrypted $6$VkpEiHbRkdT5OMca$61ihV9NBzaBG0FzDqGJZyRlepfmmn19psl49JjHX2IB50aDkXGCbY3c0/L7fBGJDbaxFLsyAEAucXUbGc4OW30
user --groups=wheel --name=admin --password=$6$AgbOOIRvm65r6Faf$hhRi7P7XB60oT5JhMhfZKX1OHfQORPvimga9WpYy8Q8f4/M1XEeMKyR4as.iVXzIB5uvP.Neyll3nvrwo5/Y31 --iscrypted --gecos="admin"
# System timezone
timezone Asia/Tbilisi --isUtc --ntpservers=pool.ntp.org
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
# Partition clearing information
clearpart --drive=sda --all --initlabel
# Disk partitioning information
autopart

%packages
@^gnome-desktop-environment
@base
@core
@directory-client
@fonts
@gnome-desktop
@input-methods
@multimedia
@network-file-system-client
@networkmanager-submodules
@office-suite
@print-client
@x11
chrony

%end

%post --log=/root/ks-post.log

# Disable Extra Services
systemctl disable bluetooth.service
systemctl disable dbus-org.bluez.service
systemctl disable ModemManager.service
systemctl disable tmp.mount
systemctl disable firstboot-graphical.service

# Repo Manipulations

## Enable Extra CentOS Repos

sed -i.bak '/enabled/d' /etc/yum.repos.d/CentOS-Base.repo
sed -i.bak 's/#baseurl/baseurl/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i.bak '/#/d' /etc/yum.repos.d/CentOS-Base.repo
sed -i.bak '/mirrorlist/d' /etc/yum.repos.d/CentOS-Base.repo
sed -i.bak 's/mirror.centos.org/ge.mirror.cloud9.ge/g' /etc/yum.repos.d/CentOS-Base.repo

## Add Google Repo for Chrome

cat << 'EOF' > /etc/yum.repos.d/CentOS-CR.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF

## Add EPEL Repo

yum -y install http://ge.mirror.cloud9.ge/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

# Update software
yum -y update
yum -y install google-chrome-stable

rm -f /etc/xdg/autostart/gnome-initial-setup-first-login.desktop

yum -y remove initial-setup
yum -y remove initial-setup-gui
yum -y remove firefox
yum -y remove empathy
yum -y install sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients policycoreutils-python
yum -y install ekiga
#yum -y install http://10.0.0.12/spark-2.8.3.rpm

CCLOAN_HOSTNAME=`ip addr | grep "link/ether" | awk '{print $2}' | head -n 1 | awk -F":" '{print "GELL"$1$2$3$4$5$6}'`
hostnamectl set-hostname $CCLOAN_HOSTNAME

%end

%addon com_redhat_kdump --disable --reserve-mb=auto
%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
