packer.json 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. "root_password": "arch",
  6. "username": "vagrant",
  7. "password": "vagrant"
  8. },
  9. "builders": [
  10. {
  11. "headless": true,
  12. "type": "virtualbox-iso",
  13. "iso_url": "{{ user `iso_url` }}",
  14. "iso_checksum_url": "{{ user `iso_checksum_url` }}",
  15. "iso_checksum_type": "sha1",
  16. "vm_name": "arch-desktop",
  17. "guest_os_type": "ArchLinux_64",
  18. "guest_additions_mode": "disable",
  19. "virtualbox_version_file": "",
  20. "vboxmanage": [
  21. ["modifyvm", "{{.Name}}", "--firmware", "efi"],
  22. ["modifyvm", "{{.Name}}", "--memory", "1024"],
  23. ["modifyvm", "{{.Name}}", "--accelerate3d", "on"]
  24. ],
  25. "boot_wait": "5s",
  26. "boot_command": [
  27. "<enter><wait40s>",
  28. "printf \"{{user `root_password`}}\\n{{user `root_password`}}\\n\" | passwd<enter>",
  29. "systemctl start sshd.service<enter>"
  30. ],
  31. "disk_size": 65536,
  32. "iso_interface": "sata",
  33. "hard_drive_interface": "sata",
  34. "output_directory": "dist/arch-desktop",
  35. "ssh_username": "root",
  36. "ssh_password": "{{user `root_password`}}",
  37. "ssh_timeout": "20m",
  38. "shutdown_command": "systemctl poweroff"
  39. }
  40. ],
  41. "provisioners": [
  42. {
  43. "type": "file",
  44. "source": "arch.sh",
  45. "destination": "arch.sh"
  46. },
  47. {
  48. "type": "file",
  49. "source": "install",
  50. "destination": "install"
  51. },
  52. {
  53. "type": "shell",
  54. "skip_clean": true,
  55. "expect_disconnect": true,
  56. "environment_vars": [
  57. "PACKER=y",
  58. "DEBUG=true",
  59. "enable_hibernation=y",
  60. "root_password={{user `root_password`}}",
  61. "username={{user `username`}}",
  62. "password={{user `password`}}"
  63. ],
  64. "script": "setup/install.sh"
  65. },
  66. {
  67. "type": "shell",
  68. "script": "setup/packer.sh",
  69. "pause_before": "30s"
  70. }
  71. ],
  72. "post-processors": [
  73. {
  74. "type": "vagrant",
  75. "compression_level": 9,
  76. "output": "dist/arch-desktop.box"
  77. }
  78. ]
  79. }