Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Ubuntu 14.04 x64 #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ubuntu-14.04-x86_64/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packer_cache
*.iso
*.box
95 changes: 95 additions & 0 deletions ubuntu-14.04-x86_64/bare_metal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/base.sh"
],
"override": {
"virtualbox": {
"execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
},
"vmware": {
"execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
}
}
}
],
"builders": [
{
"type": "virtualbox",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
"hostname={{ .Name }} <wait>",
"fb=false debconf/frontend=noninteractive <wait>",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
"initrd=/install/initrd.gz -- <enter><wait>"
],
"boot_wait": "4s",
"disk_size": 20480,
"guest_os_type": "Ubuntu_64",
"http_directory": "http",
"iso_checksum": "00a6e0bc6995e703170d940a24e9759c",
"iso_checksum_type": "md5",
"iso_url": "file:///Users/shrink/trusty-server-amd64.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "sudo halt -p",
"guest_additions_path": "/tmp/VBoxGuestAdditions.iso",
"guest_additions_url": "/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
[
"modifyvm", "{{.Name}}",
"--memory", "512"
],
[
"modifyvm", "{{.Name}}",
"--cpus", "2"
]
]
},
{
"type": "vmware",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
"hostname={{ .Name }} <wait>",
"fb=false debconf/frontend=noninteractive <wait>",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
"initrd=/install/initrd.gz -- <enter><wait>"
],
"boot_wait": "4s",
"disk_size": 20480,
"guest_os_type": "ubuntu-64",
"http_directory": "http",
"iso_checksum": "de8bb52bb9c5fd9220429499f302c0a3",
"iso_checksum_type": "md5",
"iso_url": "file:///Users/shrink/trusty-server-amd64.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "sudo halt -p",
"tools_upload_flavor": "linux",
"tools_upload_path": "/tmp/vmware-tools.iso",
"vmx_data": {
"memsize": "2048",
"numvcpus": "2"
}
}
]

, "post-processors": [
{
"type": "vagrant",
"output": "packer-ubuntu1404_x86_64.{{.Provider}}.box",
"keep_input_artifact": true
}
]
}
102 changes: 102 additions & 0 deletions ubuntu-14.04-x86_64/full.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/base.sh",
"scripts/vagrant.sh",
"scripts/vmware.sh",
"scripts/virtualbox.sh",
"scripts/ruby.sh",
"scripts/puppet.sh",
"scripts/cleanup.sh",
"scripts/zerodisk.sh"
],
"override": {
"virtualbox-iso": {
"execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
},
"vmware-iso": {
"execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
}
}
}
],
"builders": [
{
"type": "virtualbox-iso",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
"hostname={{ .Name }} <wait>",
"fb=false debconf/frontend=noninteractive <wait>",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
"initrd=/install/initrd.gz -- <enter><wait>"
],
"boot_wait": "4s",
"disk_size": 20480,
"guest_os_type": "Ubuntu_64",
"http_directory": "http",
"iso_checksum": "00a6e0bc6995e703170d940a24e9759c",
"iso_checksum_type": "md5",
"iso_url": "file:///Users/shrink/trusty-server-amd64.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "sudo halt -p",
"guest_additions_path": "/tmp/VBoxGuestAdditions.iso",
"guest_additions_url": "/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
[
"modifyvm", "{{.Name}}",
"--memory", "512"
],
[
"modifyvm", "{{.Name}}",
"--cpus", "2"
]
]
},
{
"type": "vmware-iso",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us <wait>",
"hostname={{ .Name }} <wait>",
"fb=false debconf/frontend=noninteractive <wait>",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false <wait>",
"initrd=/install/initrd.gz -- <enter><wait>"
],
"boot_wait": "4s",
"disk_size": 20480,
"guest_os_type": "ubuntu-64",
"http_directory": "http",
"iso_checksum": "de8bb52bb9c5fd9220429499f302c0a3",
"iso_checksum_type": "md5",
"iso_url": "file:///Users/shrink/trusty-server-amd64.iso",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "sudo halt -p",
"tools_upload_flavor": "linux",
"tools_upload_path": "/tmp/vmware-tools.iso",
"vmx_data": {
"memsize": "2048",
"numvcpus": "2"
}
}
]

, "post-processors": [
{
"type": "vagrant",
"output": "packer-ubuntu1404_x86_64.{{.Provider}}.box",
"keep_input_artifact": true
}
]
}
87 changes: 87 additions & 0 deletions ubuntu-14.04-x86_64/http/preseed.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
## Options to set on the command line
d-i debian-installer/locale string en_US.utf8
d-i console-setup/ask_detect boolean false
d-i console-setup/layout string USA

#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 UTC
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true

d-i kbd-chooser/method select American English

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 nfs-common build-essential autoconf zlib1g-dev libssl-dev libreadline-gplv2-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev vim curl wget bzip2 make man perl sudo

# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade select full-upgrade

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
14 changes: 14 additions & 0 deletions ubuntu-14.04-x86_64/scripts/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

apt-get -y install linux-headers-`uname -r`

# Setup sudoers for user vagrant
cat > /tmp/sudoers_vagrant <<EOM
Defaults:vagrant !requiretty
vagrant ALL=(ALL) NOPASSWD: ALL
EOM
chmod 0440 /tmp/sudoers_vagrant
mv /tmp/sudoers_vagrant /etc/sudoers.d/vagrant

# Speed up ssh logins
echo "UseDNS no" >> /etc/ssh/sshd_config
2 changes: 2 additions & 0 deletions ubuntu-14.04-x86_64/scripts/chef.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

curl -L https://www.opscode.com/chef/install.sh | bash -s -- -v "11.6.0"
18 changes: 18 additions & 0 deletions ubuntu-14.04-x86_64/scripts/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Remove items used for building, since they aren't needed anymore
# apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove

# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*

# Make sure Udev doesn't block our network
# http://6.ptmc.org/?p=164
echo "cleaning up udev rules"
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
rm /lib/udev/rules.d/75-persistent-net-generator.rules

echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces
1 change: 1 addition & 0 deletions ubuntu-14.04-x86_64/scripts/fixubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -fsSL https://raw.github.com/micahflee/fixubuntu/master/fixubuntu.sh | bash
4 changes: 4 additions & 0 deletions ubuntu-14.04-x86_64/scripts/puppet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# install puppet (3.4.4)
apt-get update
apt-get -y install puppet
Loading