Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
kickstart.erb 5.14 KiB
#!/bin/bash
# Kickstart for RHEL/CentOS 7 
# see: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html

install
url --url=<%= repo_url %>
cmdline
lang en_US.UTF-8
selinux --enforcing
keyboard us
skipx

network --bootproto dhcp --hostname <%= node.metadata['hostname'] || node.hostname %> --device=<%= node.metadata['mac_address'] || '00:00:00:00:00:00' %>
rootpw --iscrypted <%= node.metadata['root_password'] || node.root_password %>
firewall --enabled --ssh
authconfig --useshadow --passalgo=SHA256 --kickstart
timezone --utc <%= node.metadata['timezone'] || 'Europe/Prague' %>
services --disabled gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd


# This skips over the subscription for redhat.

# Avoid having 'rhgb quiet' on the boot line
bootloader --location=mbr --append="nofb quiet splash=quiet" 

# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work

<%= node.metadata['part'] %>
zerombr
clearpart --all


autopart


text
# reboot automatically
reboot

repo --name="CentOS" --baseurl="http://mirror.centos.org/centos/7/os/x86_64/"
repo --name="EPEL" --baseurl="http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/"

%packages
yum
dhclient
ntp
wget
vim
net-tools
bind-utils
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 ics-corea-007-ostack.priv.cloud.muni.cz postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3