Add packer file
This commit is contained in:
41
image.pkr.hcl
Normal file
41
image.pkr.hcl
Normal file
@@ -0,0 +1,41 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
virtualbox = {
|
||||
version = ">= 1.0.0"
|
||||
source = "github.com/hashicorp/virtualbox"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "disk_size" {
|
||||
type = string
|
||||
default = "20480" # 20 GB in MB
|
||||
}
|
||||
|
||||
source "virtualbox-iso" "ubuntu" {
|
||||
iso_url = "https://releases.ubuntu.com/22.04/ubuntu-22.04-live-server-amd64.iso"
|
||||
iso_checksum = "SHA256:...fill_in_checksum..."
|
||||
ssh_username = "vagrant"
|
||||
ssh_password = "vagrant"
|
||||
ssh_wait_timeout = "20m"
|
||||
disk_size = var.disk_size
|
||||
guest_os_type = "Ubuntu_64"
|
||||
vm_name = "packer-ubuntu"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "ubuntu20-vagrant"
|
||||
sources = ["source.virtualbox-iso.ubuntu"]
|
||||
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"sudo apt-get update",
|
||||
"sudo apt-get install -y vim git curl"
|
||||
]
|
||||
}
|
||||
|
||||
post-processor "vagrant" {
|
||||
output = "ubuntu20-vagrant.box"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user