From f70a59acfd3c2bf965c766d2858726705b74290a Mon Sep 17 00:00:00 2001 From: Iwan Clement Date: Tue, 18 Jan 2022 13:47:00 +0100 Subject: [PATCH] ready to go --- data/QuickAndDirty/rockylinux.pkr..hcl | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 data/QuickAndDirty/rockylinux.pkr..hcl diff --git a/data/QuickAndDirty/rockylinux.pkr..hcl b/data/QuickAndDirty/rockylinux.pkr..hcl new file mode 100644 index 0000000..12fe2fb --- /dev/null +++ b/data/QuickAndDirty/rockylinux.pkr..hcl @@ -0,0 +1,66 @@ +packer { +} + +source "proxmox" "rocky" { + template_name = "rocky" + template_description = "Rocky Linux Server template" + proxmox_url = "https://192.168.111.34:8006/api2/json" + node = "grosnoeud" + iso_file = "ISOS:iso/Rocky-8.5-x86_64-minimal.iso" + iso_checksum = "f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98" + insecure_skip_tls_verify = true + pool = "Linux-VM" + vm_name = "PackerTest" + vm_id = 654 + memory = 2048 + cores = 1 + sockets = 2 + os = "l26" + http_port_min = 4990 + http_port_max = 4999 + http_directory = "redhat" + username = "root@pam" + password = "bzzYpm8koNtPKFYjpjXSyjFY" + ssh_username = "firstuser" + ssh_password = "firstuser" + ssh_timeout = "10m" + #username = "packer_build@pam" + #password = "tvowyfv9gh23sdfAERtLWav2674" + #ssh_username = "packer_build" + #ssh_password = "tvowyfv9gh23sdfAERtLWav2674" + network_adapters { + model = "virtio" + bridge = "vmbr111" + } + + qemu_agent = true + scsi_controller = "virtio-scsi-pci" + + disks { + type = "scsi" + disk_size = "55G" + storage_pool = "FAST" + storage_pool_type = "lvm-thin" + format = "raw" + } + boot_wait = "5s" + "boot_command": " inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/redhat.kix" +} + +build { + sources = [ "source.proxmox.rocky" ] + + provisioner "shell" { + pause_before = "20s" + environment_vars = [ + "DEBIAN_FRONTEND=noninteractive", + ] + inline = [ + "sleep 30", + "sudo dnf -y update", + "sudo dnf -y autoremove", + "sudo truncate -s 0 /etc/machine-id", + "exit 0", + ] + } +} \ No newline at end of file