diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..449faea --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/builds +/packer_cache diff --git a/packer.json b/packer.json new file mode 100644 index 0000000..5de4de9 --- /dev/null +++ b/packer.json @@ -0,0 +1,67 @@ +{ + "provisioners": [], + "builders": [ + { + "type": "virtualbox-iso", + "boot_command": [ + "", + "", + "", + "", + "/install/vmlinuz ", + " auto ", + " console-setup/ask_detect=false ", + " console-setup/layoutcode=us ", + " console-setup/modelcode=pc105 ", + " debconf/frontend=noninteractive ", + " debian-installer=en_US ", + " fb=false ", + " initrd=/install/initrd.gz ", + " kbd-chooser/method=us ", + " keyboard-configuration/layout=USA ", + " keyboard-configuration/variant=USA ", + " locale=en_US ", + " netcfg/get_domain=vm ", + " netcfg/get_hostname=vagrant ", + " grub-installer/bootdev=/dev/sda ", + " noapic ", + " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", + " -- ", + "" + ], + "boot_wait": "10s", + "disk_size": 10000, + "guest_os_type": "Ubuntu_64", + "headless": false, + "http_directory": "preseeds", + "iso_urls": "http://releases.ubuntu.com/16.04/ubuntu-16.04.2-server-amd64.iso", + "iso_checksum_type": "sha256", + "iso_checksum": "737ae7041212c628de5751d15c3016058b0e833fdc32e7420209b76ca3d0a535", + "ssh_username": "vagrant", + "ssh_password": "vagrant", + "ssh_wait_timeout": "20m", + "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", + "vm_name": "packer-ubuntu-16.04-amd64", + "vboxmanage": [ + [ + "modifyvm", + "{{.Name}}", + "--memory", + "1024" + ], + [ + "modifyvm", + "{{.Name}}", + "--cpus", + "1" + ] + ] + } + ], + "post-processors": [ + { + "output": "builds/{{.Provider}}-mastodon-ubuntu1604.box", + "type": "vagrant" + } + ] +} diff --git a/preseeds/preseed.cfg b/preseeds/preseed.cfg new file mode 100644 index 0000000..e94135a --- /dev/null +++ b/preseeds/preseed.cfg @@ -0,0 +1,39 @@ +choose-mirror-bin mirror/http/proxy string +d-i base-installer/kernel/override-image string linux-server +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i finish-install/reboot_in_progress note +d-i grub-installer/only_debian boolean true +d-i grub-installer/with_other_os boolean true +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true +d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common +d-i pkgsel/install-language-support boolean false +d-i pkgsel/update-policy select none +d-i pkgsel/upgrade select full-upgrade +d-i time/zone string UTC +tasksel tasksel/first multiselect standard, ubuntu-server + +d-i console-setup/ask_detect boolean false +d-i keyboard-configuration/layoutcode string us +d-i keyboard-configuration/modelcode string pc105 +d-i debian-installer/locale string en_US + +# Create vagrant user account. +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/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false +d-i passwd/user-default-groups vagrant sudo +d-i passwd/user-uid string 900