Skip to content

Instantly share code, notes, and snippets.

@jcpowermac
Created October 1, 2014 12:51
Show Gist options
  • Select an option

  • Save jcpowermac/8692572cd723027f6b84 to your computer and use it in GitHub Desktop.

Select an option

Save jcpowermac/8692572cd723027f6b84 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Kickstart for RHEL/CentOS 6
# see: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html
install
url --url=http://<%= config.hanlon_server %>:<%= config.api_port %><%= config.websvc_root %>/image/os/<%= @image_uuid %>
text
lang en_US.UTF-8
keyboard us
rootpw <%= @root_password %>
network onboot yes --bootproto dhcp --hostname <%= hostname %>
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512 --enablefingerprint
selinux --disabled
timezone --utc America/Denver
bootloader --location=mbr --driveorder=sda --append=crashkernel=auto rhgb 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
zerombr
clearpart --all --initlabel
#autopart
part /boot --fstype ext4 --ondisk=sda --size=512
part pv.01 --size=1 --ondisk=sda --grow
volgroup vg_root pv.01
logvol / --vgname=vg_root --size=32768 --name=lv_root --fstype=ext4
logvol /var --vgname=vg_root --size=262144 --name=lv_var --fstype=ext4
logvol swap --size=16384 --fstype=swap --name=lv_swap --vgname=vg_root
ignoredisk --only-use=sda
# reboot automatically
reboot
# followig is MINIMAL https://partner-bugzilla.redhat.com/show_bug.cgi?id=593309
%packages --nobase
@core
%end
%post --log=/root/hanlon-post.log
curl <%= api_svc_uri %>/policy/callback/<%= policy_uuid %>/kickstart/end
curl -o /tmp/hanlon_postinstall.sh <%= api_svc_uri %>/policy/callback/<%= policy_uuid %>/postinstall/inject
echo bash /tmp/hanlon_postinstall.sh >> /etc/rc.local
chmod +x /tmp/hanlon_postinstall.sh
############
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment