jcloud/backbone/packer/backbone.json
2025-04-12 17:39:38 +08:00

56 lines
1.6 KiB
JSON

{
"builders": [
{
"boot_wait": "10s",
"cpus": "2",
"disk_image": true,
"disk_size": "{{user `disk_size`}}",
"iso_checksum": "1bf86f40534c7c4c5491bbc8064bf1b0764da8c88d5a12edce0f442bc3055784",
"iso_urls": [
"{{template_dir}}/images/ubuntu-20.04-server-cloudimg-amd64.img",
"{{template_dir}}/images/79f46c38b9e000a66d0edecf3222e2371fccd8a1.img",
"https://cloud-images.ubuntu.com/releases/focal/release-20221213/ubuntu-20.04-server-cloudimg-amd64.img"
],
"iso_target_path": "{{template_dir}}/images",
"iso_target_extension": "img",
"memory": "4096",
"output_directory": "{{template_dir}}/scratch",
"headless": true,
"qemuargs": [
[
"-cdrom",
"{{template_dir}}/cloud-init.img"
]
],
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
"ssh_password": "vagrant",
"ssh_username": "vagrant",
"type": "qemu",
"use_backing_file": false,
"vm_name": "backbone"
}
],
"post-processors": [
{
"output": "{{template_dir}}/builds/backbone.box",
"type": "vagrant"
}
],
"provisioners": [
{
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'",
"expect_disconnect": true,
"scripts": [
"{{template_dir}}/scripts/sshd.sh",
"{{template_dir}}/scripts/networking.sh",
"{{template_dir}}/scripts/update.sh",
"{{template_dir}}/scripts/cleanup.sh",
"{{template_dir}}/scripts/minimize.sh"
],
"type": "shell"
}
],
"variables": {
"disk_size": "16384"
}
}