Browse files

minimal chef install + extra templates for ubuntu netboot

  • Loading branch information...
1 parent cf493c4 commit 4b840cdef89454a3b95725926bafcf1b978bc1fa @jedi4ever committed Feb 8, 2011
View
25 templates/ubuntu-10.10-server-amd64-netboot/definition.rb
@@ -0,0 +1,25 @@
+Veewee::Session.declare( {
+ :cpu_count => '1', :memory_size=> '256',
+ :disk_size => '10140', :disk_format => 'VDI',:disk_size => '10240' ,
+ :os_type_id => 'Ubuntu_64',
+ :iso_file => "ubuntu-10.10-server-amd64-netboot.iso",
+ :iso_src => "http://archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/mini.iso",
+ :iso_md5 => "3d9f096398991ed1eaa9ff32128e199a",
+ :iso_download_timeout => "1000",
+ :boot_wait => "10",:boot_cmd_sequence => [
+ '<Tab>',
+ 'noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
+ 'hostname=%NAME% ',
+ 'fb=false debconf/frontend=noninteractive ',
+ 'console-setup/ask_detect=false console-setup/modelcode=pc105 console-setup/layoutcode=us ',
+ ' -- <Enter>'
+ ],
+ :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
+ :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
+ :ssh_host_port => "2222", :ssh_guest_port => "22",
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
+ :shutdown_cmd => "shutdown -P now",
+ :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
+ }
+)
View
43 templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh
@@ -0,0 +1,43 @@
+#http://adrianbravo.tumblr.com/post/644860401
+
+#Updating the box
+apt-get -y update
+#apt-get -y upgrade
+apt-get -y remove apparmor
+apt-get -y install linux-headers-$(uname -r) build-essential
+apt-get -y install zlib1g-dev libssl-dev libreadline5-dev
+apt-get clean
+
+#Setting up sudo
+cp /etc/sudoers /etc/sudoers.orig
+sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
+
+#Installing ruby
+wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
+tar xzvf ruby-enterprise-1.8.7-2010.02.tar.gz
+./ruby-enterprise-1.8.7-2010.02/installer -a /opt/ruby --no-dev-docs --dont-install-useful-gems
+echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
+rm -rf ./ruby-enterprise-1.8.7-2010.02/
+rm ruby-enterprise-1.8.7-2010.02.tar.gz
+
+#Installing chef
+/opt/ruby/bin/gem install chef --no-ri --no-rdoc
+
+#Installing vagrant keys
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+
+#INstalling the virtualbox guest additions
+VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
+#INstalling the virtualbox guest additions
+cd /tmp
+wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
+sh /mnt/VBoxLinuxAdditions.run
+umount /mnt
+
+rm VBoxGuestAdditions_$VBOX_VERSION.iso
+exit
View
9 templates/ubuntu-10.10-server-amd64-netboot/postinstall2.sh
@@ -0,0 +1,9 @@
+#as root
+apt-get -y install curl
+apt-get -y install git
+
+#as non root
+bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
+echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> $HOME/.bash_profile
+source "$HOME/.rvm/scripts/rvm"
+rvm install ree
View
87 templates/ubuntu-10.10-server-amd64-netboot/preseed.cfg
@@ -0,0 +1,87 @@
+## Options to set on the command line
+d-i debian-installer/locale string en_US
+d-i console-setup/ask_detect boolean false
+d-i console-setup/layout string Belgium
+
+#d-i netcfg/get_hostname string dummy
+d-i netcfg/get_hostname string unassigned-hostname
+d-i netcfg/get_domain string unassigned-domain
+
+# Continue without a default route
+# Not working , specify a dummy in the DHCP
+#d-i netcfg/no_default_route boolean
+
+d-i time/zone string Europe/Brussels
+d-i clock-setup/utc-auto boolean true
+d-i clock-setup/utc boolean true
+
+d-i kbd-chooser/method select Belgian
+
+d-i netcfg/wireless_wep string
+
+d-i base-installer/kernel/override-image string linux-server
+#d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
+
+# Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
+d-i debconf debconf/frontend select Noninteractive
+
+d-i pkgsel/install-language-support boolean false
+tasksel tasksel/first multiselect standard, ubuntu-server
+
+#d-i partman-auto/method string regular
+d-i partman-auto/method string lvm
+#d-i partman-auto/purge_lvm_from_device boolean true
+
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-auto/choose_recipe select atomic
+
+d-i partman/confirm_write_new_label boolean true
+d-i partman/confirm_nooverwrite boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+
+#http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
+#Message: "write the changes to disk and configure lvm preseed"
+#http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
+#preseed partman-lvm/confirm_nooverwrite boolean true
+
+# Write the changes to disks and configure LVM?
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
+d-i partman-auto-lvm/guided_size string max
+
+## Default user, we can get away with a recipe to change this
+d-i passwd/user-fullname string vagrant
+d-i passwd/username string vagrant
+d-i passwd/user-password password vagrant
+d-i passwd/user-password-again password vagrant
+d-i user-setup/encrypt-home boolean false
+d-i user-setup/allow-password-weak boolean true
+
+## minimum is puppet and ssh and ntp
+# Individual additional packages to install
+d-i pkgsel/include string openssh-server ntp
+
+# Whether to upgrade packages after debootstrap.
+# Allowed values: none, safe-upgrade, full-upgrade
+d-i pkgsel/upgrade select none
+
+d-i grub-installer/only_debian boolean true
+d-i grub-installer/with_other_os boolean true
+d-i finish-install/reboot_in_progress note
+
+#For the update
+d-i pkgsel/update-policy select none
+
+# debconf-get-selections --install
+#Use mirror
+#d-i apt-setup/use_mirror boolean true
+#d-i mirror/country string manual
+#choose-mirror-bin mirror/protocol string http
+#choose-mirror-bin mirror/http/hostname string 192.168.4.150
+#choose-mirror-bin mirror/http/directory string /ubuntu
+#choose-mirror-bin mirror/suite select maverick
+#d-i debian-installer/allow_unauthenticated string true
+
+choose-mirror-bin mirror/http/proxy string
View
25 templates/ubuntu-10.10-server-i386-netboot/definition.rb
@@ -0,0 +1,25 @@
+Veewee::Session.declare( {
+ :cpu_count => '1', :memory_size=> '256',
+ :disk_size => '10140', :disk_format => 'VDI',:disk_size => '10240' ,
+ :os_type_id => 'Ubuntu',
+ :iso_file => "ubuntu-10.10-server-i386-netboot.iso",
+ :iso_src => "http://archive.ubuntu.com/ubuntu/dists/maverick/main/installer-i386/current/images/netboot/mini.iso",
+ :iso_md5 => "02abb1a71bde21a1335e9368dad529ca",
+ :iso_download_timeout => "1000",
+ :boot_wait => "10",:boot_cmd_sequence => [
+ '<Tabr>',
+ 'noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
+ 'hostname=%NAME% ',
+ 'fb=false debconf/frontend=noninteractive ',
+ 'console-setup/ask_detect=false console-setup/modelcode=pc105 console-setup/layoutcode=us ',
+ ' -- <Enter>'
+ ],
+ :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
+ :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
+ :ssh_host_port => "2222", :ssh_guest_port => "22",
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
+ :shutdown_cmd => "shutdown -P now",
+ :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
+ }
+)
View
43 templates/ubuntu-10.10-server-i386-netboot/postinstall.sh
@@ -0,0 +1,43 @@
+#http://adrianbravo.tumblr.com/post/644860401
+
+#Updating the box
+apt-get -y update
+#apt-get -y upgrade
+apt-get -y remove apparmor
+apt-get -y install linux-headers-$(uname -r) build-essential
+apt-get -y install zlib1g-dev libssl-dev libreadline5-dev
+apt-get clean
+
+#Setting up sudo
+cp /etc/sudoers /etc/sudoers.orig
+sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
+
+#Installing ruby
+wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
+tar xzvf ruby-enterprise-1.8.7-2010.02.tar.gz
+./ruby-enterprise-1.8.7-2010.02/installer -a /opt/ruby --no-dev-docs --dont-install-useful-gems
+echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
+rm -rf ./ruby-enterprise-1.8.7-2010.02/
+rm ruby-enterprise-1.8.7-2010.02.tar.gz
+
+#Installing chef
+/opt/ruby/bin/gem install chef --no-ri --no-rdoc
+
+#Installing vagrant keys
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+
+#INstalling the virtualbox guest additions
+VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
+#INstalling the virtualbox guest additions
+cd /tmp
+wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
+sh /mnt/VBoxLinuxAdditions.run
+umount /mnt
+
+rm VBoxGuestAdditions_$VBOX_VERSION.iso
+exit
View
9 templates/ubuntu-10.10-server-i386-netboot/postinstall2.sh
@@ -0,0 +1,9 @@
+#as root
+apt-get -y install curl
+apt-get -y install git
+
+#as non root
+bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
+echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> $HOME/.bash_profile
+source "$HOME/.rvm/scripts/rvm"
+rvm install ree
View
87 templates/ubuntu-10.10-server-i386-netboot/preseed.cfg
@@ -0,0 +1,87 @@
+## Options to set on the command line
+d-i debian-installer/locale string en_US
+d-i console-setup/ask_detect boolean false
+d-i console-setup/layout string Belgium
+
+#d-i netcfg/get_hostname string dummy
+d-i netcfg/get_hostname string unassigned-hostname
+d-i netcfg/get_domain string unassigned-domain
+
+# Continue without a default route
+# Not working , specify a dummy in the DHCP
+#d-i netcfg/no_default_route boolean
+
+d-i time/zone string Europe/Brussels
+d-i clock-setup/utc-auto boolean true
+d-i clock-setup/utc boolean true
+
+d-i kbd-chooser/method select Belgian
+
+d-i netcfg/wireless_wep string
+
+d-i base-installer/kernel/override-image string linux-server
+#d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
+
+# Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
+d-i debconf debconf/frontend select Noninteractive
+
+d-i pkgsel/install-language-support boolean false
+tasksel tasksel/first multiselect standard, ubuntu-server
+
+#d-i partman-auto/method string regular
+d-i partman-auto/method string lvm
+#d-i partman-auto/purge_lvm_from_device boolean true
+
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-auto/choose_recipe select atomic
+
+d-i partman/confirm_write_new_label boolean true
+d-i partman/confirm_nooverwrite boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+
+#http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
+#Message: "write the changes to disk and configure lvm preseed"
+#http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
+#preseed partman-lvm/confirm_nooverwrite boolean true
+
+# Write the changes to disks and configure LVM?
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
+d-i partman-auto-lvm/guided_size string max
+
+## Default user, we can get away with a recipe to change this
+d-i passwd/user-fullname string vagrant
+d-i passwd/username string vagrant
+d-i passwd/user-password password vagrant
+d-i passwd/user-password-again password vagrant
+d-i user-setup/encrypt-home boolean false
+d-i user-setup/allow-password-weak boolean true
+
+## minimum is puppet and ssh and ntp
+# Individual additional packages to install
+d-i pkgsel/include string openssh-server ntp
+
+# Whether to upgrade packages after debootstrap.
+# Allowed values: none, safe-upgrade, full-upgrade
+d-i pkgsel/upgrade select none
+
+d-i grub-installer/only_debian boolean true
+d-i grub-installer/with_other_os boolean true
+d-i finish-install/reboot_in_progress note
+
+#For the update
+d-i pkgsel/update-policy select none
+
+# debconf-get-selections --install
+#Use mirror
+#d-i apt-setup/use_mirror boolean true
+#d-i mirror/country string manual
+#choose-mirror-bin mirror/protocol string http
+#choose-mirror-bin mirror/http/hostname string 192.168.4.150
+#choose-mirror-bin mirror/http/directory string /ubuntu
+#choose-mirror-bin mirror/suite select maverick
+#d-i debian-installer/allow_unauthenticated string true
+
+choose-mirror-bin mirror/http/proxy string

0 comments on commit 4b840cd

Please sign in to comment.