<commit_before>install
text
cdrom
reboot --eject
lang en_US.UTF-8
keyboard us
rootpw r00tme
timezone --utc America/New_York
bootloader --location=mbr
clearpart --all --initlabel
autopart
#part /boot --fstype ext3 --size=250
#part pv.01 size=5000 --grow
#volgroup Nailgun --pesize=32768 pv.01
#logvol / --fstype ext4 --name=root --vgname=Nailgun --size=1024 --grow
#logvol swap --fstype swap --name=swap --vgname=Nailgun --size=512 --grow --maxsize=4096

%packages --nobase --excludedocs
puppet
yum

%post --log=/root/post-log
function setconf {
	echo
	echo -n "Enter hostname: "; read hostname
	echo -n "Enter device name: "; read device
	echo -n "Enter ip: "; read ip
	echo -n "Enter netmask: "; read netmask
	echo -n "Enter default gw: "; read gw
	echo -n "Enter First DNS server: "; read dns1
	echo -n "Enter Second DNS server: "; read dns2
	hwaddr=`ifconfig $device | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`
	echo
	echo You entered:
	show
	echo
	echo -n "Do you want to keep this settings (y/N):"
	read -n 1 answer
	if [[ $answer == "y" || $answer == "Y" ]]; then
		save_cfg
	fi
	echo
	echo -n "Do you want to configure another adapter (y/N):"
	read -n 1 answer
	if [[ $answer == "n" || $answer == "N" || $answer == "" ]]; then 
	    endconf=1
	fi
	}

function show {
	echo "Device: $device, MAC address $hwaddr"
	echo "Hostname: $hostname"
	[ -z $ip ] && dhcp=1 && echo "IP address: will be obtained via DHCP"
	[ ! -z $ip ] && dhcp=0 && echo "IP address: $ip Netmask: $netmask"
	echo "Gateway: $gw"
	echo "DNS Server 1: $dns1"
	echo "DNS Server 2: $dns2"
	}

function save_cfg {
	scrFile="/etc/sysconfig/network-scripts/ifcfg-$device"
	sed -i -e 's#^\(HOSTNAME=\).*$#\1'"$hostname"'#' /etc/sysconfig/network
	echo GATEWAY=$gw >> /etc/sysconfig/network
 
	echo DEVICE=$device > $scrFile
	echo ONBOOT=yes >> $scrFile
	echo NM_CONTROLLED=no >> $scrFile
	echo HWADDR=$hwaddr >> $scrFile
	echo USERCTL=no >> $scrFile
	if [ $dhcp -eq 0 ]; then
		echo BOOTPROTO=static >> $scrFile
		echo IPADDR=$ip >> $scrFile
		echo NETMASK=$netmask >> $scrFile
		[ -z $dns1 ] || echo DNS1=$dns1 >> $scrFile
		[ -z $dns2 ] || echo DNS2=$dns2 >> $scrFile
	else
		echo BOOTPROTO=dhcp >> $scrFile
	fi
    	}

set -- `cat /proc/cmdline`
for I in $*; do case "$I" in *=*) eval $I;; esac ; done
hostname="nailgun"
ip=$ip 
netmask=$netmask
gw=$gw
device="eth0"
hwaddr=`ifconfig $device | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`

curTTY=`tty`
exec < $curTTY > $curTTY 2> $curTTY
clear

endconf=0
show
echo -n "Press any key to make changes in network configuration"
read -n 1 -t 5 answer
if [ $? -gt 128 ]; then
	save_cfg
else
	while [ $endconf -eq 0 ]; do
		echo
		echo -n "Do you want to configure settings manually (y/N):"
		read -n 1 answer
		if [[ $answer == "y" || $answer == "Y" ]]; then
		    setconf
		else
		    endconf=1
		fi
	done
fi

# Mounting cd
echo
mkdir /tmp/cdrom
mount /dev/cdrom /tmp/cdrom

# Copying Repo to the nailgun /var/www directory
repodir="/var/www"
mkdir -p ${repodir}/centos
mkdir -p ${repodir}/eggs
mkdir -p ${repodir}/gems
cp -r /tmp/cdrom/images ${repodir}/centos
cp -r /tmp/cdrom/isolinux ${repodir}/centos
cp -r /tmp/cdrom/repodata ${repodir}/centos
cp -r /tmp/cdrom/Packages ${repodir}/centos
cp -r /tmp/cdrom/eggs ${repodir}/eggs
cp -r /tmp/cdrom/gems ${repodir}/gems

# Copying puppet manifests
cp -r /tmp/cdrom/puppet/* /etc/puppet/modules/

# Copying bootstrap_admin_node.sh , chmod it and adding to the rc.local to run it once
cp /tmp/cdrom/bootstrap_admin_node.sh /tmp
chmod 0777 /tmp/bootstrap_admin_node.sh
echo "/tmp/bootstrap_admin_node.sh" >> /etc/rc.local

# Unmounting cd to succesfull eject
umount -f /dev/cdrom
rm -rf /tmp/cdrom

%end<commit_msg>Mcollective added to the base install of admin node, gems/eggs placed under /var/www/nailgun directory<commit_after>install
text
cdrom
reboot --eject
lang en_US.UTF-8
keyboard us
rootpw r00tme
timezone --utc America/New_York
bootloader --location=mbr
clearpart --all --initlabel
autopart
#part /boot --fstype ext3 --size=250
#part pv.01 size=5000 --grow
#volgroup Nailgun --pesize=32768 pv.01
#logvol / --fstype ext4 --name=root --vgname=Nailgun --size=1024 --grow
#logvol swap --fstype swap --name=swap --vgname=Nailgun --size=512 --grow --maxsize=4096

%packages --nobase --excludedocs
mcollective
puppet
yum

%post --log=/root/post-log
function setconf {
	echo
	echo -n "Enter hostname: "; read hostname
	echo -n "Enter device name: "; read device
	echo -n "Enter ip: "; read ip
	echo -n "Enter netmask: "; read netmask
	echo -n "Enter default gw: "; read gw
	echo -n "Enter First DNS server: "; read dns1
	echo -n "Enter Second DNS server: "; read dns2
	hwaddr=`ifconfig $device | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`
	echo
	echo You entered:
	show
	echo
	echo -n "Do you want to keep this settings (y/N):"
	read -n 1 answer
	if [[ $answer == "y" || $answer == "Y" ]]; then
		save_cfg
	fi
	echo
	echo -n "Do you want to configure another adapter (y/N):"
	read -n 1 answer
	if [[ $answer == "n" || $answer == "N" || $answer == "" ]]; then 
	    endconf=1
	fi
	}

function show {
	echo "Device: $device, MAC address $hwaddr"
	echo "Hostname: $hostname"
	[ -z $ip ] && dhcp=1 && echo "IP address: will be obtained via DHCP"
	[ ! -z $ip ] && dhcp=0 && echo "IP address: $ip Netmask: $netmask"
	echo "Gateway: $gw"
	echo "DNS Server 1: $dns1"
	echo "DNS Server 2: $dns2"
	}

function save_cfg {
	scrFile="/etc/sysconfig/network-scripts/ifcfg-$device"
	sed -i -e 's#^\(HOSTNAME=\).*$#\1'"$hostname"'#' /etc/sysconfig/network
	echo GATEWAY=$gw >> /etc/sysconfig/network
 
	echo DEVICE=$device > $scrFile
	echo ONBOOT=yes >> $scrFile
	echo NM_CONTROLLED=no >> $scrFile
	echo HWADDR=$hwaddr >> $scrFile
	echo USERCTL=no >> $scrFile
	if [ $dhcp -eq 0 ]; then
		echo BOOTPROTO=static >> $scrFile
		echo IPADDR=$ip >> $scrFile
		echo NETMASK=$netmask >> $scrFile
		[ -z $dns1 ] || echo DNS1=$dns1 >> $scrFile
		[ -z $dns2 ] || echo DNS2=$dns2 >> $scrFile
	else
		echo BOOTPROTO=dhcp >> $scrFile
	fi
    	}

set -- `cat /proc/cmdline`
for I in $*; do case "$I" in *=*) eval $I;; esac ; done
hostname="nailgun"
ip=$ip 
netmask=$netmask
gw=$gw
device="eth0"
hwaddr=`ifconfig $device | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`

curTTY=`tty`
exec < $curTTY > $curTTY 2> $curTTY
clear

endconf=0
show
echo -n "Press any key to make changes in network configuration"
read -n 1 -t 5 answer
if [ $? -gt 128 ]; then
	save_cfg
else
	while [ $endconf -eq 0 ]; do
		echo
		echo -n "Do you want to configure settings manually (y/N):"
		read -n 1 answer
		if [[ $answer == "y" || $answer == "Y" ]]; then
		    setconf
		else
		    endconf=1
		fi
	done
fi

# Mounting cd
echo
mkdir /tmp/cdrom
mount /dev/cdrom /tmp/cdrom

# Copying Repo to the nailgun /var/www directory
repodir="/var/www"
mkdir -p ${repodir}/centos
mkdir -p ${repodir}/eggs
mkdir -p ${repodir}/gems
cp -r /tmp/cdrom/images ${repodir}/centos
cp -r /tmp/cdrom/isolinux ${repodir}/centos
cp -r /tmp/cdrom/repodata ${repodir}/centos
cp -r /tmp/cdrom/Packages ${repodir}/centos
cp -r /tmp/cdrom/eggs ${repodir}/nailgun/eggs
cp -r /tmp/cdrom/gems ${repodir}/nailgun/gems

# Copying puppet manifests
cp -r /tmp/cdrom/puppet/* /etc/puppet/modules/

# Copying bootstrap_admin_node.sh , chmod it and adding to the rc.local to run it once
cp /tmp/cdrom/bootstrap_admin_node.sh /tmp
chmod 0777 /tmp/bootstrap_admin_node.sh
echo "/tmp/bootstrap_admin_node.sh" >> /etc/rc.local

# Unmounting cd to succesfull eject
umount -f /dev/cdrom
rm -rf /tmp/cdrom

%end
{'fraction_non_alphanumeric': 0.15649514692195188, 'fraction_numerical': 0.017550857598723574, 'mean_word_length': 3.496114763897191, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, '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': '3244897', 'n_tokens_mistral': 3129, 'n_tokens_neox': 2965, 'n_words': 907}