Skip to content

Instantly share code, notes, and snippets.

@smacfarlane
Last active August 29, 2015 14:21
Show Gist options
  • Save smacfarlane/a10b73f08fc54b051b2a to your computer and use it in GitHub Desktop.
Save smacfarlane/a10b73f08fc54b051b2a to your computer and use it in GitHub Desktop.
Packer qemu template
{
"builders": [
{
"type": "qemu",
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos-6.6/ks.cfg<enter><wait>"
],
"boot_wait": "2s",
"disk_size": 20480,
"format": "qcow2",
"accelerator": "kvm",
"headless": false,
"disk_interface": "virtio",
"http_directory": "http",
"iso_checksum": "08be09fd7276822bd3468af8f96198279ffc41f0",
"iso_checksum_type": "sha1",
"iso_url": "{{user `mirror`}}/6.6/isos/x86_64/CentOS-6.6-x86_64-bin-DVD1.iso",
"output_directory": "uafgina-centos-6.6-x86_64-s",
"vm_name": "uafgina-centos-6.6-x86_64-s",
"shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"ssh_password": "{{user `user_password`}}",
"ssh_port": 22,
"ssh_username": "vagrant",
"ssh_wait_timeout": "10000s",
"qemuargs": [
[ "-m", "480m"]
]
}
],
"provisioners": [
{
"environment_vars": [
"CHEF_VERSION={{user `chef_version`}}"
],
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/centos/fix-slow-dns.sh",
"scripts/common/sshd.sh",
"scripts/common/chef.sh",
"scripts/centos/cleanup.sh"
],
"type": "shell"
}
],
"variables": {
"chef_version": "12.2.1",
"mirror": "http://centos.mbni.med.umich.edu/mirror",
"user_password": "{{env `PACKER_SSH_PASSWORD`}}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment