packer.json 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. "headless": true,
  11. "type": "virtualbox-iso",
  12. "iso_url": "{{ user `iso_url` }}",
  13. "iso_checksum": "file:{{ user `iso_checksum_url` }}",
  14. "vm_name": "arch-desktop",
  15. "guest_os_type": "ArchLinux_64",
  16. "guest_additions_mode": "disable",
  17. "virtualbox_version_file": "",
  18. "firmware": "efi",
  19. "gfx_controller": "vmsvga",
  20. "gfx_accelerate_3d": false,
  21. "gfx_vram_size": 32,
  22. "memory": 1024,
  23. "cpus": 2,
  24. "boot_wait": "5s",
  25. "boot_command": [
  26. "<enter><wait60s>",
  27. "printf \"{{user `root_password`}}\\n{{user `root_password`}}\\n\" | passwd<enter>",
  28. "systemctl is-active --quiet sshd.service || systemctl start sshd.service<enter>"
  29. ],
  30. "iso_interface": "sata",
  31. "hard_drive_interface": "sata",
  32. "output_directory": "dist/arch-desktop",
  33. "ssh_username": "root",
  34. "ssh_password": "{{user `root_password`}}",
  35. "ssh_timeout": "20m",
  36. "shutdown_command": "systemctl poweroff"
  37. }],
  38. "provisioners": [
  39. {
  40. "type": "shell-local",
  41. "command": "rm -rf upload/arch-desktop.tar && tar cf upload/arch-desktop.tar ../install ../arch.sh ../setup vagrant.sh"
  42. },
  43. {
  44. "type": "file",
  45. "source": "upload",
  46. "destination": "upload"
  47. },
  48. {
  49. "type": "shell",
  50. "inline": [
  51. "mv upload/arch-desktop.tar .",
  52. "tar xf arch-desktop.tar",
  53. "rm -rf upload",
  54. "rm arch-desktop.tar"
  55. ]
  56. },
  57. {
  58. "type": "shell-local",
  59. "command": "rm -rf upload/arch-desktop.tar"
  60. },
  61. {
  62. "type": "shell",
  63. "skip_clean": true,
  64. "environment_vars": [
  65. "DEBUG=y",
  66. "enable_hibernation=y",
  67. "hostname=vagrant",
  68. "root_password={{user `root_password`}}",
  69. "username={{user `username`}}",
  70. "password={{user `password`}}"
  71. ],
  72. "script": "../setup/install.sh"
  73. },
  74. {
  75. "type": "shell",
  76. "inline": ["arch-chroot /mnt /srv/arch-desktop/vagrant.sh"]
  77. }
  78. ],
  79. "post-processors": [
  80. {
  81. "type": "vagrant",
  82. "compression_level": 9,
  83. "output": "dist/arch-desktop.box"
  84. }
  85. ]
  86. }