From 4f87c8b8364eb14f28452b73988d185ab060f32b Mon Sep 17 00:00:00 2001 From: Iwan Clement Date: Tue, 28 Dec 2021 18:07:57 +0100 Subject: [PATCH] stepping forward --- data/20.04.pkrvars.hcl | 20 ++++---- data/Linux.pkr.hcl | 103 +++++++++++++++++++++-------------------- 2 files changed, 62 insertions(+), 61 deletions(-) diff --git a/data/20.04.pkrvars.hcl b/data/20.04.pkrvars.hcl index f78f223..0567f07 100644 --- a/data/20.04.pkrvars.hcl +++ b/data/20.04.pkrvars.hcl @@ -2,16 +2,16 @@ username = "proxmox_user" password = "tvowyfv9gh23sdfAERtLWav2674" proxmox_url = "https://192.168.111.34:8006/api2/json" node = "grosnoeud" -iso_file = "" -os_version = "20.04" -os_family = "ubuntu" -guest_os_type = "ubuntu64Guest" -os_iso_path = "[SATAStorage] ISO/ubuntu-20.04-legacy-server-amd64.iso" -os_iso_url = "http://cdimage.ubuntu.com/ubuntu-legacy-server/releases/20.04/release/ubuntu-20.04-legacy-server-amd64.iso"` -iso_checksum = "36f15879bd9dfd061cd588620a164a82972663fdd148cce1f70d57d314c21b73" -root_disk_size = 24000 -connection_username = "vagrant" -connection_password = "vagrant" +iso_file = "local:ISOS/ubuntu-20.04.3-live-server-amd64.iso" +iso_checksum = "f8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98" +insecure_skip_tls_verify = true +pool = "FAST" +vm_name = "VM-UBU_PackerTest" +vm_id = 654 +memory = 1024 +core = 1 +sockets = 2 +os = "l26" boot_command = [ "", "", diff --git a/data/Linux.pkr.hcl b/data/Linux.pkr.hcl index e096c70..a100a43 100644 --- a/data/Linux.pkr.hcl +++ b/data/Linux.pkr.hcl @@ -1,54 +1,3 @@ -source "proxmox-iso" "windows" { - # vCenter settings - vcenter_server = var.vcenter_server - username = var.vcenter_username - password = var.vcenter_password - insecure_connection = true #TODO: Add ca to docker - cluster = var.vcenter_cluster - datacenter = var.vcenter_datacenter - host = var.vcenter_host - datastore = var.vcenter_datastore - convert_to_template = true - folder = var.vcenter_folder - - # VM Settings - ip_wait_timeout = "45m" - communicator = "winrm" - winrm_username = var.connection_username - winrm_password = var.connection_password - winrm_timeout = "12h" - winrm_port = "5985" - shutdown_command = "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"" - shutdown_timeout = "15m" - vm_version = var.vm_hardware_version - iso_paths = [ - var.os_iso_path - ] - iso_checksum = var.iso_checksum - vm_name = "server-${ var.os_version }-{{ isotime \"2006-01-02\" }}" - guest_os_type = var.guest_os_type - disk_controller_type = ["pvscsi"] # Windows requires vmware tools drivers for pvscsi to work - network_adapters { - # For windows, the vmware tools network drivers are required to be connected by floppy before tools is installed - network = var.vm_network - network_card = var.nic_type - } - storage { - disk_size = var.root_disk_size - disk_thin_provisioned = true - } - CPUs = var.num_cpu - cpu_cores = var.num_cores - CPU_hot_plug = true - RAM = var.vm_ram - RAM_hot_plug = true - floppy_files = [ - "./boot_config/${var.os_version}/Autounattend.xml", - "./scripts/winrm.bat", - "./scripts/Install-VMWareTools.ps1", - "./drivers/" - ] -} source "proxmox-iso" "ubuntu" { # vCenter settings vcenter_server = var.vcenter_server @@ -137,6 +86,58 @@ source "proxmox-iso" "centos" { boot_command = var.boot_command } +source "proxmox-iso" "windows" { + # vCenter settings + vcenter_server = var.vcenter_server + username = var.vcenter_username + password = var.vcenter_password + insecure_connection = true #TODO: Add ca to docker + cluster = var.vcenter_cluster + datacenter = var.vcenter_datacenter + host = var.vcenter_host + datastore = var.vcenter_datastore + convert_to_template = true + folder = var.vcenter_folder + + # VM Settings + ip_wait_timeout = "45m" + communicator = "winrm" + winrm_username = var.connection_username + winrm_password = var.connection_password + winrm_timeout = "12h" + winrm_port = "5985" + shutdown_command = "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"" + shutdown_timeout = "15m" + vm_version = var.vm_hardware_version + iso_paths = [ + var.os_iso_path + ] + iso_checksum = var.iso_checksum + vm_name = "server-${ var.os_version }-{{ isotime \"2006-01-02\" }}" + guest_os_type = var.guest_os_type + disk_controller_type = ["pvscsi"] # Windows requires vmware tools drivers for pvscsi to work + network_adapters { + # For windows, the vmware tools network drivers are required to be connected by floppy before tools is installed + network = var.vm_network + network_card = var.nic_type + } + storage { + disk_size = var.root_disk_size + disk_thin_provisioned = true + } + CPUs = var.num_cpu + cpu_cores = var.num_cores + CPU_hot_plug = true + RAM = var.vm_ram + RAM_hot_plug = true + floppy_files = [ + "./boot_config/${var.os_version}/Autounattend.xml", + "./scripts/winrm.bat", + "./scripts/Install-VMWareTools.ps1", + "./drivers/" + ] +} + build { # Windows builds sources = [