67 lines
1.6 KiB
HCL
67 lines
1.6 KiB
HCL
|
packer {
|
||
|
required_plugins {
|
||
|
xenserver= {
|
||
|
version = ">= v0.3.2"
|
||
|
source = "github.com/ddelnano/xenserver"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
variable "sr_iso_name" {
|
||
|
type = string
|
||
|
default = "ISOs"
|
||
|
description = "The ISO-SR to packer will use"
|
||
|
|
||
|
}
|
||
|
|
||
|
variable "sr_name" {
|
||
|
type = string
|
||
|
default = "Local storageD"
|
||
|
description = "The name of the SR to packer will use"
|
||
|
}
|
||
|
|
||
|
locals {
|
||
|
timestamp = regex_replace(timestamp(), "[- TZ:]", "")
|
||
|
}
|
||
|
|
||
|
|
||
|
source "xenserver-iso" "debian-11" {
|
||
|
iso_checksum = "55f6f49b32d3797621297a9481a6cc3e21b3142f57d8e1279412ff5a267868d8"
|
||
|
iso_checksum_type = "sha256"
|
||
|
iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-11.6.0-amd64-DVD-1.iso"
|
||
|
|
||
|
sr_iso_name = var.sr_iso_name
|
||
|
sr_name = var.sr_name
|
||
|
tools_iso_name = "guest-tools.iso"
|
||
|
|
||
|
remote_host = var.remote_host
|
||
|
remote_password = var.remote_password
|
||
|
remote_username = var.remote_username
|
||
|
|
||
|
# Change this to match the ISO of ubuntu you are using in the iso_url variable
|
||
|
clone_template = "Debian Bullseye 11"
|
||
|
vm_name = "packer-debian-11-${local.timestamp}"
|
||
|
vm_description = "Build started: ${local.timestamp}"
|
||
|
vcpus_max = 4
|
||
|
vcpus_atstartup = 4
|
||
|
vm_memory = 4096
|
||
|
disk_size = 10000
|
||
|
|
||
|
floppy_files = [
|
||
|
"debian-preseed.cfg",
|
||
|
]
|
||
|
|
||
|
ssh_username = "cecile"
|
||
|
ssh_password = "cecile"
|
||
|
ssh_wait_timeout = "60000s"
|
||
|
ssh_handshake_attempts = 10000
|
||
|
|
||
|
output_directory = "packer-debian-11-iso"
|
||
|
keep_vm = "always"
|
||
|
format = "none"
|
||
|
}
|
||
|
|
||
|
build {
|
||
|
sources = ["xenserver-iso.debian-11"]
|
||
|
}
|