packer.json 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {
  2. "variables": {
  3. "iso_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/archlinux-{{isotime \"2006.01\"}}.01-x86_64.iso",
  4. "iso_checksum_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/sha1sums.txt",
  5. "efi_bios": "/usr/share/ovmf/x64/OVMF.fd",
  6. "root_password": "arch",
  7. "username": "vagrant",
  8. "password": "vagrant"
  9. },
  10. "builders": [
  11. {
  12. "headless": true,
  13. "type": "qemu",
  14. "iso_url": "{{ user `iso_url` }}",
  15. "iso_checksum": "file:{{ user `iso_checksum_url` }}",
  16. "vm_name": "arch-desktop",
  17. "format": "qcow2",
  18. "accelerator": "kvm",
  19. "output_directory": "dist/arch-desktop",
  20. "firmware": "{{ user `efi_bios` }}",
  21. "memory": 1024,
  22. "disk_size": "20G",
  23. "disk_interface": "virtio",
  24. "net_device": "virtio-net",
  25. "ssh_username": "root",
  26. "ssh_password": "{{user `root_password`}}",
  27. "ssh_timeout": "20m",
  28. "shutdown_command": "systemctl poweroff",
  29. "boot_wait": "5s",
  30. "boot_command": [
  31. "<enter><wait60s>",
  32. "printf \"{{user `root_password`}}\\n{{user `root_password`}}\\n\" | passwd<enter>",
  33. "systemctl is-active --quiet sshd.service || systemctl start sshd.service<enter>"
  34. ]
  35. }
  36. ],
  37. "provisioners": [
  38. {
  39. "type": "shell-local",
  40. "command": "rm -rf upload/arch-desktop.tar && tar cf upload/arch-desktop.tar ../install ../arch.sh ../setup"
  41. },
  42. {
  43. "type": "file",
  44. "source": "upload",
  45. "destination": "upload"
  46. },
  47. {
  48. "type": "shell",
  49. "inline": [
  50. "mv upload/arch-desktop.tar .",
  51. "tar xf arch-desktop.tar",
  52. "rm -rf upload",
  53. "rm arch-desktop.tar"
  54. ]
  55. },
  56. {
  57. "type": "shell-local",
  58. "command": "rm -rf upload/arch-desktop.tar"
  59. },
  60. {
  61. "type": "shell",
  62. "skip_clean": true,
  63. "environment_vars": [
  64. "DEBUG=y",
  65. "enable_hibernation=y",
  66. "hostname=vagrant",
  67. "disk=vda",
  68. "root_password={{user `root_password`}}",
  69. "username={{user `username`}}",
  70. "password={{user `password`}}"
  71. ],
  72. "script": "../setup/install.sh"
  73. }
  74. ],
  75. "post-processors": [
  76. {
  77. "type": "vagrant",
  78. "compression_level": 9,
  79. "output": "dist/arch-desktop.box"
  80. }
  81. ]
  82. }