Skip to content

Instantly share code, notes, and snippets.

@briancline
Created November 25, 2014 20:58
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 briancline/98c5a0c7e2638e854033 to your computer and use it in GitHub Desktop.
Save briancline/98c5a0c7e2638e854033 to your computer and use it in GitHub Desktop.
Packer template for Ubuntu Server 14.04.1
{
"variables": {
"template": "unknown"
},
"builders": [
{
"type": "qemu",
"iso_url": "http://mirror.utexas.edu/ubuntu-iso/CDs-Ubuntu/14.04.1/ubuntu-14.04.1-server-amd64.iso",
"iso_checksum": "946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2",
"iso_checksum_type": "sha256",
"disk_size": 5120,
"vm_name": "ci-{{user `template`}}",
"ssh_username": "ci",
"ssh_password": "citest",
"headless": true,
"http_directory": "preseed",
"boot_command": [
"<esc>",
"<esc>",
"<enter>",
"<wait>",
"install ",
"locale=en_US ",
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu-14.04.1.cfg ",
"priority=critical ",
"debconf/frontend=noninteractive ",
"<enter>"
],
"shutdown_command" : "sudo poweroff",
"qemuargs": [
[ "-smp", "4" ]
]
}
],
"provisioners": [
{
"type": "file",
"source": "scripts/ttyS0.conf",
"destination": "/tmp/ttyS0.conf"
},
{
"type": "shell",
"script": "scripts/serial-console-enable.sh",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
},
{
"type": "shell",
"environment_vars": [
"DEBIAN_FRONTEND=noninteractive"
],
"execute_command": "{{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"mv /tmp/ttyS0.conf /etc/init/ttyS0.conf",
"chown root.root /etc/init/ttyS0.conf",
"apt-get -q -y dist-upgrade",
"apt-get -q -y install cloud-init"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment