<commit_before># kickstart host is <%= %x{hostname} %>
# vm hostname is <%= $settings[:hostname] %>
# product: centos
# version: 6
# arch: i386

# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype ext2 --size=100
part pv.01 --size=1 --grow
volgroup vg00 pv.01
logvol / --name=rootvol --vgname=vg00 --size=1 --grow --fstype ext3
logvol swap --name=swapvol --vgname=vg00 --size=256
# Use the *real* text mode install
cmdline
# Install OS instead of upgrade
install
# Use CDROM install media
cdrom
#repo --name=cdrom --baseurl=cdrom:sr0 --cost=100
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System authorization information
auth  --useshadow  --enablemd5  --enablecache
#Root password
rootpw --iscrypted <PASSWORD>/
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# System timezone
timezone UTC
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Installation logging level
logging --level=info
# Shutdown after installation so we don't have to
poweroff

#Packages
%packages
@Core
@base
ntp
curl
tar
ruby

%post
exec < /dev/tty3 > /dev/tty3
chvt 3
(
set -x
mount /dev/sr0 /mnt
groupadd -r puppet
useradd -d /var/lib/puppet -g puppet -M -r puppet
cd /root
# Set the dns info and hostname; must be done before puppet
cat <<EOF > /etc/resolv.conf
domain puppetlabs.vm
nameserver 8.8.8.8
EOF
sed -i 's/HOSTNAME.*/HOSTNAME=<%= $settings[:hostname] %>/' /etc/sysconfig/network
hostname <%= $settings[:hostname] %>

yum upgrade openssl -y

sed -i 's/127\.0\.0\.1.*/\0 <%= $settings[:hostname] %> <%= $settings[:hostname].split('.')[0] %>/' /etc/hosts
cp /mnt/puppet/<%= $settings[:pe_tarball] %> /root/
<% if $settings[:vmtype] == "learning" %>
<% if File.extname($settings[:pe_tarball]) == ".gz" %>
tar zmxf /root/<%= $settings[:pe_tarball] %>
<% tname = File.basename($settings[:pe_tarball], ".gz") %>
<% fname = File.basename(tname, ".tar") %>
<% elsif File.extname($settings[:pe_tarball]) == ".tar" %>
tar mxf /root/<%= $settings[:pe_tarball] %>
<% fname = File.basename($settings[:pe_tarball], ".tar") %>
<% else abort("Not sure what type of file #{$settings[:pe_tarball]} is") %>
<% end %>
ln -s /root/<%= fname %> /root/puppet-enterprise
rm -f /root/<%= $settings[:pe_tarball] %>
<% end %>

# Cache agent tarball for pe_repo
mkdir -p /usr/src/installer
mkdir -p /usr/src/installer/<%= @real_pe_ver %>
cp /mnt/puppet/<%= $settings[:agent_tarball] %> /usr/src/installer/<%= @real_pe_ver %>/

# put verification script links in personal bin directory
<% if $settings[:vmtype] == "training" %>
ln -s /usr/src/puppetlabs-training-bootstrap/scripts/classroom /root/bin
<% end %>

rpm -Uvh /mnt/puppet/epel-release.rpm
yum -y install git
#yum -y upgrade #This takes a while
cd /usr/src
git clone /mnt/puppet/puppet.git
cd puppet && git remote rename origin ks && git remote add origin git://github.com/puppetlabs/puppet.git && git fetch origin && git branch --set-upstream master origin/master && git checkout 3.2.4 ; cd /usr/src
git clone /mnt/puppet/facter.git
cd facter && git remote rename origin ks && git remote add origin git://github.com/puppetlabs/facter.git && git fetch origin && git branch --set-upstream master origin/master && git checkout 1.7.1 ; cd /usr/src
git clone /mnt/puppet/hiera.git
cd hiera && git remote rename origin ks && git remote add origin git://github.com/puppetlabs/hiera.git && git fetch origin && git branch --set-upstream master origin/master && git checkout 1.2.1 ; cd /usr/src
git clone /mnt/puppet/puppetlabs-training-bootstrap.git
cd puppetlabs-training-bootstrap && git checkout <%= @ptbbranch %>
cd /root
RUBYLIB=/usr/src/puppet/lib:/usr/src/facter/lib:/usr/src/hiera/lib
export RUBYLIB
/usr/src/puppet/bin/puppet apply --modulepath=/usr/src/puppetlabs-training-bootstrap/modules --verbose /usr/src/puppetlabs-training-bootstrap/manifests/site.pp || /bin/true
# Cleanup from the puppet run<commit_msg>Remove /root/bin from the kickstart.<commit_after># kickstart host is <%= %x{hostname} %>
# vm hostname is <%= $settings[:hostname] %>
# product: centos
# version: 6
# arch: i386

# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype ext2 --size=100
part pv.01 --size=1 --grow
volgroup vg00 pv.01
logvol / --name=rootvol --vgname=vg00 --size=1 --grow --fstype ext3
logvol swap --name=swapvol --vgname=vg00 --size=256
# Use the *real* text mode install
cmdline
# Install OS instead of upgrade
install
# Use CDROM install media
cdrom
#repo --name=cdrom --baseurl=cdrom:sr0 --cost=100
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System authorization information
auth  --useshadow  --enablemd5  --enablecache
#Root password
rootpw --iscrypted $1$jrm5tnjw$h8JJ9mCZLmJvIxvDLjw1M/
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# System timezone
timezone UTC
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Installation logging level
logging --level=info
# Shutdown after installation so we don't have to
poweroff

#Packages
%packages
@Core
@base
ntp
curl
tar
ruby

%post
exec < /dev/tty3 > /dev/tty3
chvt 3
(
set -x
mount /dev/sr0 /mnt
groupadd -r puppet
useradd -d /var/lib/puppet -g puppet -M -r puppet
cd /root
# Set the dns info and hostname; must be done before puppet
cat <<EOF > /etc/resolv.conf
domain puppetlabs.vm
nameserver 8.8.8.8
EOF
sed -i 's/HOSTNAME.*/HOSTNAME=<%= $settings[:hostname] %>/' /etc/sysconfig/network
hostname <%= $settings[:hostname] %>

yum upgrade openssl -y

sed -i 's/127\.0\.0\.1.*/\0 <%= $settings[:hostname] %> <%= $settings[:hostname].split('.')[0] %>/' /etc/hosts
cp /mnt/puppet/<%= $settings[:pe_tarball] %> /root/
<% if $settings[:vmtype] == "learning" %>
<% if File.extname($settings[:pe_tarball]) == ".gz" %>
tar zmxf /root/<%= $settings[:pe_tarball] %>
<% tname = File.basename($settings[:pe_tarball], ".gz") %>
<% fname = File.basename(tname, ".tar") %>
<% elsif File.extname($settings[:pe_tarball]) == ".tar" %>
tar mxf /root/<%= $settings[:pe_tarball] %>
<% fname = File.basename($settings[:pe_tarball], ".tar") %>
<% else abort("Not sure what type of file #{$settings[:pe_tarball]} is") %>
<% end %>
ln -s /root/<%= fname %> /root/puppet-enterprise
rm -f /root/<%= $settings[:pe_tarball] %>
<% end %>

# Cache agent tarball for pe_repo
mkdir -p /usr/src/installer
mkdir -p /usr/src/installer/<%= @real_pe_ver %>
cp /mnt/puppet/<%= $settings[:agent_tarball] %> /usr/src/installer/<%= @real_pe_ver %>/

rpm -Uvh /mnt/puppet/epel-release.rpm
yum -y install git
#yum -y upgrade #This takes a while
cd /usr/src
git clone /mnt/puppet/puppet.git
cd puppet && git remote rename origin ks && git remote add origin git://github.com/puppetlabs/puppet.git && git fetch origin && git branch --set-upstream master origin/master && git checkout 3.2.4 ; cd /usr/src
git clone /mnt/puppet/facter.git
cd facter && git remote rename origin ks && git remote add origin git://github.com/puppetlabs/facter.git && git fetch origin && git branch --set-upstream master origin/master && git checkout 1.7.1 ; cd /usr/src
git clone /mnt/puppet/hiera.git
cd hiera && git remote rename origin ks && git remote add origin git://github.com/puppetlabs/hiera.git && git fetch origin && git branch --set-upstream master origin/master && git checkout 1.2.1 ; cd /usr/src
git clone /mnt/puppet/puppetlabs-training-bootstrap.git
cd puppetlabs-training-bootstrap && git checkout <%= @ptbbranch %>
cd /root
RUBYLIB=/usr/src/puppet/lib:/usr/src/facter/lib:/usr/src/hiera/lib
export RUBYLIB
/usr/src/puppet/bin/puppet apply --modulepath=/usr/src/puppetlabs-training-bootstrap/modules --verbose /usr/src/puppetlabs-training-bootstrap/manifests/site.pp || /bin/true
# Cleanup from the puppet run
{'fraction_non_alphanumeric': 0.15379931807111544, 'fraction_numerical': 0.014003896736483196, 'mean_word_length': 4.1299188007495315, 'pattern_counts': {'":': 0, '<': 60, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1645130', 'n_tokens_mistral': 3078, 'n_tokens_neox': 2854, 'n_words': 837}