packer-xcp-ng/debian-complied.pkr.hcl

85 lines
2.4 KiB
HCL
Raw Normal View History

2023-04-14 17:16:54 +02:00
variable "remote_host" {
type = string
description = "The ip or fqdn of your XCP-ng. This will be pulled from the env var 'PKR_VAR_XAPI_HOST'"
sensitive = true
default = "IP"
}
variable "remote_password" {
type = string
description = "The password used to interact with your XCP-ng. This will be pulled from the env var 'PKR_VAR_XAPI_PASSWORD'"
sensitive = true
default = "passw0rd"
}
variable "remote_username" {
type = string
description = "The username used to interact with your XCP-ng. This will be pulled from the env var 'PKR_VAR_XAPI_USERNAME'"
sensitive = true
default = "root"
}
variable "sr_iso_name" {
type = string
default = "ISOSR"
description = "The ISO-SR to packer will use"
}
variable "sr_name" {
type = string
default = "SR"
description = "The name of the SR to packer will use"
}
locals {
timestamp = regex_replace(timestamp(), "[- TZ:]", "")
}
source "xcp-ng-iso" "debian-11" {
iso_checksum = "ce1dcd1fa272976ddc387554202013e69ecf1b02b38fba4f8c35c8b12b8f521e"
iso_checksum_type = "sha256"
iso_url = "https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/archive/11.5.0+nonfree/amd64/iso-cd/firmware-11.5.0-amd64-netinst.iso"
sr_iso_name = var.sr_iso_name
sr_name = var.sr_name
tools_iso_name = ""
remote_host = var.remote_host
remote_password = var.remote_password
remote_username = var.remote_username
boot_command = [
"<wait><wait><wait><esc><wait><wait><wait>",
"/install.amd/vmlinuz ",
"initrd=/install.amd/initrd.gz ",
"auto=true ",
"url=http://IPpreseed/preseed.cfg ",
"hostname=YeahItsWorks ",
"domain=ataxya.lab ",
"interface=auto ",
"vga=788 noprompt quiet--- <enter>"
]
# Change this to match the ISO of ubuntu you are using in the iso_url variable
clone_template = "Debian Bullseye 11"
vm_name = "My-super-Golden-Image-${local.timestamp}"
vm_description = "Build started: ${local.timestamp}"
vcpus_max = 4
vcpus_atstartup = 4
vm_memory = 4096
disk_size = 10000
ssh_username = "packer"
ssh_password = "packer"
ssh_wait_timeout = "60000s"
ssh_handshake_attempts = 10000
output_directory = "packer-debian-11-iso"
keep_vm = "always"
format = "xva"
}
build {
sources = ["xcp-ng-iso.debian-11"]
}