12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- {
- "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",
- "efi_bios": "/usr/share/ovmf/x64/OVMF.fd",
- "root_password": "arch",
- "username": "vagrant",
- "password": "vagrant"
- },
- "builders": [
- {
- "headless": true,
- "type": "qemu",
- "iso_url": "{{ user `iso_url` }}",
- "iso_checksum": "file:{{ user `iso_checksum_url` }}",
- "vm_name": "arch-desktop",
- "format": "qcow2",
- "accelerator": "kvm",
- "output_directory": "dist/arch-desktop",
- "firmware": "{{ user `efi_bios` }}",
- "memory": 1024,
- "disk_size": "20G",
- "disk_interface": "virtio",
- "net_device": "virtio-net",
- "ssh_username": "root",
- "ssh_password": "{{user `root_password`}}",
- "ssh_timeout": "20m",
- "shutdown_command": "systemctl poweroff",
- "boot_wait": "5s",
- "boot_command": [
- "<enter><wait60s>",
- "printf \"{{user `root_password`}}\\n{{user `root_password`}}\\n\" | passwd<enter>",
- "systemctl is-active --quiet sshd.service || systemctl start sshd.service<enter>"
- ]
- }
- ],
- "provisioners": [
- {
- "type": "shell-local",
- "command": "rm -rf upload/arch-desktop.tar && tar cf upload/arch-desktop.tar ../install ../arch.sh ../setup"
- },
- {
- "type": "file",
- "source": "upload",
- "destination": "upload"
- },
- {
- "type": "shell",
- "inline": [
- "mv upload/arch-desktop.tar .",
- "tar xf arch-desktop.tar",
- "rm -rf upload",
- "rm arch-desktop.tar"
- ]
- },
- {
- "type": "shell-local",
- "command": "rm -rf upload/arch-desktop.tar"
- },
- {
- "type": "shell",
- "skip_clean": true,
- "environment_vars": [
- "DEBUG=y",
- "enable_hibernation=y",
- "hostname=vagrant",
- "disk=vda",
- "root_password={{user `root_password`}}",
- "username={{user `username`}}",
- "password={{user `password`}}"
- ],
- "script": "../setup/install.sh"
- }
- ],
- "post-processors": [
- {
- "type": "vagrant",
- "compression_level": 9,
- "output": "dist/arch-desktop.box"
- }
- ]
- }
|