Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install
- url --url http://download.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/x86_64/os
- lang en_US.UTF-8
- selinux --permissive
- keyboard gb
- #skipx
- network --bootproto dhcp --device=[actual MAC] --hostname [hostname]
- rootpw --iscrypted [hash]
- firewall --service=ssh
- authconfig --useshadow --passalgo=sha256 --kickstart
- timezone --utc UTC
- repo --name=fedora-everything --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=x86_64
- repo --name=puppetlabs-products --baseurl=http://yum.puppetlabs.com/fedora/f20/products/x86_64
- repo --name=puppetlabs-deps --baseurl=http://yum.puppetlabs.com/fedora/f20/dependencies/x86_64
- #bootloader --location=mbr --append="nofb quiet splash=quiet"
- bootloader --location=mbr --append=""
- zerombr
- clearpart --all
- part /boot --fstype ext4 --size=1000
- part swap --size=4096
- part / --fstype ext4 --size=100 --grow
- text
- xconfig --defaultdesktop=gnome --startxonboot
- reboot
- %packages
- yum
- dhclient
- ntp
- wget
- @Core
- @gnome-desktop
- redhat-lsb-core
- puppet
- puppetlabs-release
- %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 postinstall"
- exec < /dev/tty3 > /dev/tty3
- #changing to VT 3 so that we can see whats going on....
- /usr/bin/chvt 3
- (
- # primary interface
- real=`ip -o link | grep [MAC] | awk '{print $2;}' | sed s/://`
- cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real
- BOOTPROTO="dhcp"
- DEVICE="$real"
- HWADDR="[MAC]"
- ONBOOT=yes
- EOF
- #update local time
- echo "updating system time"
- /usr/sbin/ntpdate -sub 0.fedora.pool.ntp.org
- /usr/sbin/hwclock --systohc
- # update all the base packages from the updates repository
- yum -t -y -e 0 update
- echo "Configuring puppet"
- cat > /etc/puppet/puppet.conf << EOF
- [main]
- vardir = /var/lib/puppet
- logdir = /var/log/puppet
- rundir = /var/run/puppet
- ssldir = \$vardir/ssl
- [agent]
- pluginsync = true
- report = true
- ignoreschedules = true
- daemon = false
- ca_server = [Foreman host]
- certname = [host]
- environment = production
- server = [Foreman host]
- EOF
- # Setup puppet to run on system reboot
- /sbin/chkconfig --level 345 puppet on
- /usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server [Foreman host] --no-daemonize
- sync
- # Inform the build system that we are done.
- echo "Informing Foreman that we are built"
- wget -q -O /dev/null --no-check-certificate http://[Foreman host]:80/unattended/built?token=[token]
- # Sleeping an hour for debug
- ) 2>&1 | tee /root/install.post.log
- exit 0
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement