Advertisement
iainhallam

Foreman community Kickstart with graphics added

Feb 10th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. install
  2. url --url http://download.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/x86_64/os
  3. lang en_US.UTF-8
  4. selinux --permissive
  5. keyboard gb
  6. #skipx
  7.  
  8.  
  9. network --bootproto dhcp --device=[actual MAC] --hostname [hostname]
  10.  
  11. rootpw --iscrypted [hash]
  12. firewall --service=ssh
  13. authconfig --useshadow --passalgo=sha256 --kickstart
  14. timezone --utc UTC
  15.  
  16.  
  17. repo --name=fedora-everything --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=x86_64
  18. repo --name=puppetlabs-products --baseurl=http://yum.puppetlabs.com/fedora/f20/products/x86_64
  19. repo --name=puppetlabs-deps --baseurl=http://yum.puppetlabs.com/fedora/f20/dependencies/x86_64
  20.  
  21. #bootloader --location=mbr --append="nofb quiet splash=quiet"
  22. bootloader --location=mbr --append=""
  23.  
  24. zerombr
  25. clearpart --all
  26. part /boot --fstype ext4 --size=1000
  27. part swap --size=4096
  28. part / --fstype ext4 --size=100 --grow
  29.  
  30.  
  31. text
  32. xconfig --defaultdesktop=gnome --startxonboot
  33. reboot
  34.  
  35. %packages
  36. yum
  37. dhclient
  38. ntp
  39. wget
  40. @Core
  41. @gnome-desktop
  42. redhat-lsb-core
  43.  
  44. puppet
  45. puppetlabs-release
  46. %end
  47.  
  48. %post --nochroot
  49. exec < /dev/tty3 > /dev/tty3
  50. #changing to VT 3 so that we can see whats going on....
  51. /usr/bin/chvt 3
  52. (
  53. cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
  54. /usr/bin/chvt 1
  55. ) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
  56. %end
  57. %post
  58. logger "Starting anaconda postinstall"
  59. exec < /dev/tty3 > /dev/tty3
  60. #changing to VT 3 so that we can see whats going on....
  61. /usr/bin/chvt 3
  62. (
  63.  
  64.  
  65. # primary interface
  66. real=`ip -o link | grep [MAC] | awk '{print $2;}' | sed s/://`
  67.  
  68. cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$real
  69. BOOTPROTO="dhcp"
  70. DEVICE="$real"
  71. HWADDR="[MAC]"
  72. ONBOOT=yes
  73. EOF
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. #update local time
  83. echo "updating system time"
  84. /usr/sbin/ntpdate -sub 0.fedora.pool.ntp.org
  85. /usr/sbin/hwclock --systohc
  86.  
  87.  
  88. # update all the base packages from the updates repository
  89. yum -t -y -e 0 update
  90.  
  91.  
  92. echo "Configuring puppet"
  93. cat > /etc/puppet/puppet.conf << EOF
  94.  
  95. [main]
  96. vardir = /var/lib/puppet
  97. logdir = /var/log/puppet
  98. rundir = /var/run/puppet
  99. ssldir = \$vardir/ssl
  100.  
  101. [agent]
  102. pluginsync = true
  103. report = true
  104. ignoreschedules = true
  105. daemon = false
  106. ca_server = [Foreman host]
  107. certname = [host]
  108. environment = production
  109. server = [Foreman host]
  110.  
  111. EOF
  112.  
  113. # Setup puppet to run on system reboot
  114. /sbin/chkconfig --level 345 puppet on
  115.  
  116. /usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server [Foreman host] --no-daemonize
  117.  
  118.  
  119. sync
  120.  
  121. # Inform the build system that we are done.
  122. echo "Informing Foreman that we are built"
  123. wget -q -O /dev/null --no-check-certificate http://[Foreman host]:80/unattended/built?token=[token]
  124. # Sleeping an hour for debug
  125. ) 2>&1 | tee /root/install.post.log
  126. exit 0
  127.  
  128. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement