packer.json 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. "expect_disconnect": true,
  65. "environment_vars": [
  66. "DEBUG=y",
  67. "enable_hibernation=y",
  68. "hostname=vagrant",
  69. "root_password={{user `root_password`}}",
  70. "username={{user `username`}}",
  71. "password={{user `password`}}"
  72. ],
  73. "script": "../setup/install.sh"
  74. },
  75. {
  76. "type": "shell",
  77. "inline": ["arch-chroot /mnt /srv/arch-desktop/vagrant.sh"]
  78. }
  79. ],
  80. "post-processors": [
  81. {
  82. "type": "vagrant",
  83. "compression_level": 9,
  84. "output": "dist/arch-desktop.box"
  85. }
  86. ]
  87. }