Skip to content

Instantly share code, notes, and snippets.

@emj365
Last active September 9, 2018 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emj365/4b3d1ae899b0f5ea0cd5a9e5fe3993c2 to your computer and use it in GitHub Desktop.
Save emj365/4b3d1ae899b0f5ea0cd5a9e5fe3993c2 to your computer and use it in GitHub Desktop.
packer example
# Installation
# ============
# Based off Chad Thompson's:
# https://raw.githubusercontent.com/chad-thompson/packer-example/master/ubuntu-simple-preseed.cfg
# Clock and Timezone
# ------------------
# ### Hardware Clock
# Setting the hardware clock to UTC is considered best practice and may be
# assumed by some pacakges
d-i clock-setup/utc boolean true
# ### Timezone
# Generally the server timezone should be set to a value which is logically tied
# to the purpose of the server. The generic nature of this vagrant box lends
# itself to 'GMT' as it is the global time standard.
d-i time/zone string GMT
# Account Setup
# -------------
# ### User Credentials
# It is conventional to create a user named 'vagrant' with a password of
# 'vagrant' which vagrant will login as. Please note that these credentials are
# public knowledge and you should never have this account on a public server.
d-i passwd/user-fullname string packer
d-i passwd/username string packer
d-i passwd/user-password password packer
d-i passwd/user-password-again password packer
d-i user-setup/allow-password-weak boolean true
# ### Home Directory Encryption
# The home directory is not encrypted to aviod any issues that this may cause.
d-i user-setup/encrypt-home boolean false
# Partitioning
# ------------
# ### LVM Partitioning
# The entire disk is partitioned using LVM and any prompts that LVM partitioning
# raises are confirmed automatically.
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select atomic
# Old LVM partitions are overwritten, pre-existing raid partitions are removed.
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
# The ubuntu installer will prompt for confirmation of the partitioning
# strategies.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman/confirm_nooverwrite boolean true
# Packages & Updates
# ------------------
# ### No proxy
# By default there is no proxy set for the mirror.
d-i mirror/http/proxy string
# ### No automatic updates
# Automatic updates are not applied, everything is updated manually.
d-i pkgsel/update-policy select none
# ### Ubuntu server
# The standard ubuntu server
tasksel tasksel/first multiselect standard
d-i pkgsel/install-language-support boolean false
# ### OpenSSH Server
# Vagrant requires the OpenSSH server to be installed in order to be able to
# manage the VM.
d-i pkgsel/include string openssh-server
# Boot loader installation
# ------------------------
# The default boot loader (grub) is installed as the boot loader on the server
# and all prompts which it throws up are automatically confirmed.
d-i grub-installer/only_debian boolean true
# Complete installation
# ---------------------
# Ubuntu show a final message once the installation is complete. This message is
# affirmed so it doesn't block the installation process.
d-i finish-install/reboot_in_progress note
{
"variables": {
"Name": "test",
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "Ubuntu_64",
"iso_url":
"http://releases.ubuntu.com/12.04/ubuntu-12.04.5-server-amd64.iso",
"iso_checksum": "769474248a3897f4865817446f9a4a53",
"iso_checksum_type": "md5",
"ssh_username": "packer",
"ssh_password": "packer",
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'packer' | sudo -S shutdown -P now",
"http_directory": "http",
"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 ",
"hostname={{ .Name }} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment