Skip to content

Instantly share code, notes, and snippets.

@tyjak
Created January 12, 2016 20:44
Show Gist options
  • Save tyjak/f8be1171f5cee954aad0 to your computer and use it in GitHub Desktop.
Save tyjak/f8be1171f5cee954aad0 to your computer and use it in GitHub Desktop.
packer template for archlinux
{
"variables": {
"iso_url": "https://mirrors.kernel.org/archlinux/iso/latest/archlinux-2016.01.01-dual.iso",
"iso_checksum": "ff79a9629a83dfedad6c3a58e2e7838c86282315",
"iso_checksum_type": "sha1"
},
"builders": [
{
"type": "virtualbox-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"guest_os_type": "ArchLinux_64",
"guest_additions_mode": "disable",
"http_directory": ".",
"boot_wait": "5s",
"boot_command": [
"<enter><wait10><wait10>",
"/usr/bin/curl -O http://{{.HTTPIP}}:{{.HTTPPort}}/install-virtualbox.sh<enter><wait5>",
"/usr/bin/curl -O http://{{.HTTPIP}}:{{.HTTPPort}}/poweroff.timer<enter><wait5>",
"/usr/bin/bash ./install-virtualbox.sh<enter>"
],
"disk_size": 20480,
"hard_drive_interface": "sata",
"headless": false,
"ssh_wait_timeout": "3600s",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"shutdown_command": "systemctl start poweroff.timer"
},
{
"type": "vmware-iso",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"http_directory": ".",
"boot_wait": "5s",
"boot_command": [
"<enter><wait10><wait10>",
"/usr/bin/curl -O http://{{.HTTPIP}}:{{.HTTPPort}}/install-vmware.sh<enter><wait5>",
"/usr/bin/curl -O http://{{.HTTPIP}}:{{.HTTPPort}}/poweroff.timer<enter><wait5>",
"/usr/bin/bash ./install-vmware.sh<enter>"
],
"disk_size": 20480,
"ssh_username": "root",
"ssh_password": "vagrant",
"shutdown_command": "systemctl start poweroff.timer"
}
],
"post-processors": [
{
"type": "vagrant",
"output": "packer_arch_{{.Provider}}.box"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment