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

Commit

Permalink
Merges in @reubenavery's Lucid addition.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickcharlton committed Aug 12, 2014
2 parents 714171a + 0718702 commit d5ccfb9
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 5 deletions.
26 changes: 22 additions & 4 deletions common/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,31 @@ apt-get -qy upgrade
# install some oft used packages
apt-get -qy install linux-headers-$(uname -r) build-essential
apt-get -qy install zlib1g-dev libssl-dev
apt-get -qy install ruby1.9.3

case $(lsb_release -cs) in
'lucid')
apt-get -qy install ruby-full

# manually install a mucher newer version of rubygems
curl -O http://production.cf.rubygems.org/rubygems/rubygems-2.3.0.tgz
tar -xf rubygems-2.3.0.tgz
cd rubygems-2.3.0/
ruby setup.rb --no-ri --no-rdoc --no-format-executable
cd ../

# and then update rdoc (force ensures the executable is overwritten)
gem install rdoc -v 4.1.1 -no-ri --no-rdoc --force
gem install rdoc-data; rdoc-data --install
;;
*)
apt-get -qy install ruby1.9.3
;;
esac

# configure password-less sudo
usermod -a -G sudo vagrant
echo "%vagrant ALL=NOPASSWD:ALL" > /tmp/vagrant
mv /tmp/vagrant /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers

# install the vagrant-provided ssh keys
mkdir -pm 700 /home/vagrant/.ssh
Expand Down
72 changes: 72 additions & 0 deletions ubuntu/lucid64.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"provisioners": [
{
"type": "shell",
"scripts": [
"common/postinstall.sh",
"common/vmtools.sh",
<%- if @type == "standard" -%>
"common/chef.sh",
"common/puppet.sh",
<%- else -%>
"common/<%= @type %>.sh",
<%- end -%>
"common/purge.sh"
],
"execute_command": "echo 'vagrant' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'"
}
],

"builders": [
{
"name": "lucid64-<%= @type %>",
"type": "<%= @builder %>",
<%- if @builder == "vmware-iso" -%>
"guest_os_type": "ubuntu-64",
"tools_upload_flavor": "linux",
<%- else -%>
"guest_os_type": "Ubuntu_64",
<%- end -%>
"headless": true,

"iso_url": "http://releases.ubuntu.com/10.04/ubuntu-10.04.4-server-amd64.iso",
"iso_checksum": "9b218654cdcdf9722171648c52f8a088",
"iso_checksum_type": "md5",

"ssh_username": "vagrant",
"ssh_password": "vagrant",

"http_directory": "ubuntu",

"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz ",
"noapic ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US ",
"auto ",
"locale=en_US ",
"kbd-chooser/method=us ",
"netcfg/get_domain=vm ",
"netcfg/get_hostname={{ .Name }} ",
"fb=false ",
"debconf/frontend=noninteractive ",
"keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA ",
"console-setup/ask_detect=false ",
"console-setup/layoutcode=us ",
"console-setup/modelcode=pc105 ",
"initrd=/install/initrd.gz ",
"-- <enter>"
],

"shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'vagrant'|sudo -S sh 'shutdown.sh'"
}
],

"post-processors": [
{
"type": "vagrant"
}
]
}
2 changes: 1 addition & 1 deletion ubuntu/preseed.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ d-i user-setup/encrypt-home boolean false
# packages
tasksel tasksel/first multiselect standard, ubuntu-server
d-i pkgsel/install-language-support boolean false
d-i pkgsel/include string openssh-server nfs-common curl git
d-i pkgsel/include string openssh-server nfs-common curl git-core
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select none
postfix postfix/main_mailer_type select No configuration
Expand Down

0 comments on commit d5ccfb9

Please sign in to comment.