packer-arch/arch-template.json
Christian Kotte 31965a8808
Add variable/option to control if zeros are written to the disk
It takes some time to write zeros to the disk and it aborts later if
less than 20GB are available.

Add variable to the template, cleanup script and add a new option to
wrapacker.
2020-07-13 13:25:35 +02:00

138 lines
5.5 KiB
JSON

{
"variables": {
"iso_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/archlinux-{{isotime \"2006.01\"}}.01-x86_64.iso",
"iso_checksum_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/sha1sums.txt",
"ssh_timeout": "20m",
"country": "US",
"write_zeros": "true",
"headless": "false"
},
"builders": [
{
"type": "parallels-iso",
"parallels_tools_flavor": "lin",
"parallels_tools_mode": "attach",
"guest_os_type": "linux-2.6",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "file:{{ user `iso_checksum_url` }}",
"http_directory": "srv",
"boot_wait": "5s",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/enable-ssh.sh<enter><wait5>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/poweroff.timer<enter><wait5>",
"/usr/bin/bash ./enable-ssh.sh<enter>"
],
"cpus": 1,
"memory": 768,
"disk_size": 20480,
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_timeout": "{{ user `ssh_timeout` }}",
"shutdown_command": "sudo systemctl start poweroff.timer"
},
{
"type": "virtualbox-iso",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "file:{{ user `iso_checksum_url` }}",
"guest_os_type": "ArchLinux_64",
"guest_additions_mode": "disable",
"http_directory": "srv",
"boot_wait": "5s",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/enable-ssh.sh<enter><wait5>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/poweroff.timer<enter><wait5>",
"/usr/bin/bash ./enable-ssh.sh<enter>"
],
"cpus": 1,
"memory": 768,
"disk_size": 20480,
"hard_drive_interface": "sata",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_timeout": "{{ user `ssh_timeout` }}",
"shutdown_command": "sudo systemctl start poweroff.timer",
"headless": "{{ user `headless`}}"
},
{
"type": "vmware-iso",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "file:{{ user `iso_checksum_url` }}",
"http_directory": "srv",
"boot_wait": "5s",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/enable-ssh.sh<enter><wait5>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/poweroff.timer<enter><wait5>",
"/usr/bin/bash ./enable-ssh.sh<enter>"
],
"cpus": 1,
"memory": 768,
"disk_size": 20480,
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_timeout": "{{ user `ssh_timeout` }}",
"shutdown_command": "sudo systemctl start poweroff.timer",
"headless": "{{ user `headless`}}"
},
{
"type": "qemu",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum": "file:{{ user `iso_checksum_url` }}",
"http_directory": "srv",
"boot_wait": "5s",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/enable-ssh.sh<enter><wait5>",
"/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/poweroff.timer<enter><wait5>",
"/usr/bin/bash ./enable-ssh.sh<enter>"
],
"cpus": 1,
"memory": 768,
"disk_size": 20480,
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_timeout": "{{ user `ssh_timeout` }}",
"shutdown_command": "sudo systemctl start poweroff.timer",
"headless": "{{ user `headless`}}"
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "{{ .Vars }} COUNTRY={{ user `country` }} sudo -E -S bash '{{ .Path }}'",
"expect_disconnect": true,
"script": "scripts/install-base.sh"
},
{
"only": ["parallels-iso"],
"type": "shell",
"execute_command": "{{ .Vars }} sudo -E -S bash '{{ .Path }}'",
"script": "scripts/install-parallels.sh"
},
{
"only": ["virtualbox-iso"],
"type": "shell",
"execute_command": "{{ .Vars }} sudo -E -S bash '{{ .Path }}'",
"script": "scripts/install-virtualbox.sh"
},
{
"only": ["vmware-iso"],
"type": "shell",
"execute_command": "{{ .Vars }} sudo -E -S bash '{{ .Path }}'",
"script": "scripts/install-vmware.sh"
},
{
"type": "shell",
"execute_command": "{{ .Vars }} WRITE_ZEROS={{ user `write_zeros` }} sudo -E -S bash '{{ .Path }}'",
"script": "scripts/cleanup.sh"
}
],
"post-processors": [
{
"type": "vagrant",
"output": "output/packer_arch_{{ .Provider }}-{{isotime \"2006.01\"}}.01.box"
}
]
}