Files
MyMasters/data/QuickAndDirty/test.pkr.hcl
2022-01-17 02:38:38 +01:00

72 lines
2.1 KiB
HCL

packer {
}
source "proxmox" "ubuntu" {
# image = "ubuntu:focal"
# proxmox_url = "http:/192.168.111.34:8006/api2/json"
# commit = true
proxmox_url = "https://192.168.111.34:8006/api2/json"
node = "grosnoeud"
iso_file = "local:ISOS/ubuntu-20.04.3-live-server-amd64.iso"
iso_checksum = "f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98"
insecure_skip_tls_verify = true
pool = "FAST"
vm_name = "PackerTest.ivanclement.maison"
vm_id = 654
memory = 1024
cores = 1
sockets = 2
os = "l26"
username = "root@pam"
password = "bzzYpm8koNtPKFYjpjXSyjFY"
ssh_username = "root@pam"
ssh_password = "bzzYpm8koNtPKFYjpjXSyjFY"
#username = "packer_build"
#password = "tvowyfv9gh23sdfAERtLWav2674"
#ssh_username = "packer_build"
#ssh_password = "tvowyfv9gh23sdfAERtLWav2674"
network_adapters {
model = "virtio"
bridge = "vmbr0"
}
qemu_agent = true
scsi_controller = "virtio-scsi-pci"
disks {
type = "scsi"
disk_size = "30G"
storage_pool = "FAST"
storage_pool_type = "lvm-thin"
format = "raw"
}
boot_command = [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz",
" auto=true",
" url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
" locale=en_US<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=packer<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic<wait>",
" -- <wait>",
"<enter><wait>"
]
}
build {
sources = [ "source.proxmox.ubuntu" ]
}