diff --git a/README.md b/README.md index 6e2b74677..468c124f8 100644 --- a/README.md +++ b/README.md @@ -349,17 +349,7 @@ The directory structure of the repository. ├── ansible │ ├── roles │ │ └── -│ │ ├── defaults -│ │ │ └── main.yml -│ │ ├── handlers -│ │ │ └── main.yml -│ │ ├── meta -│ │ │ └── main.yml -│ │ ├── tasks -│ │ │ └── main.yml -│ │ │ └── *.yml -│ │ └── vars -│ │ └── main.yml +│ │ └── *.yml │ ├── ansible.cfg │ └── main.yml ├── artifacts @@ -397,7 +387,7 @@ The directory structure of the repository. The files are distributed in the following directories. * **`ansible`** - contains the Ansible roles to prepare Linux machine image builds. -* **`artifacts`** - contains the OVF artifacts created by the builds, if enabled. +* **`artifacts`** - contains the OVF artifacts exported by the builds, if enabled. * **`builds`** - contains the templates, variables, and configuration files for the machine image builds. * **`scripts`** - contains the scripts to initialize and prepare Windows machine image builds. * **`manifests`** - manifests created after the completion of the machine image builds. @@ -407,13 +397,20 @@ The files are distributed in the following directories. > > When forking the project for upstream contribution, please be mindful not to make changes that may expose your sensitive information, such as passwords, keys, certificates, etc. -### Step 2 - Download the Guest Operating Systems ISOs +### Step 2 - Guest Operating Systems ISOs -1. Download the x64 guest operating system [.iso][iso] images. +The project supports configuring the ISO from either a datastore or URL source. By default, the project uses the datastore source. + +Follow the steps below to configure either option. +#### Using a Datastore Source + +If you are using a datastore to store your guest operating system [`.iso`][iso] files, you must download and upload these to a datastore path. + +1. Download the x64 guest operating system `.iso` files. Linux Distributions: - * VMware Photon OS 4 Server + * VMware Photon OS 4 * [Download][download-linux-photon-server-4] the 4.0 Rev2 release of the **FULL** `.iso` image. (_e.g._ `photon-4.0-xxxxxxxxx.iso`) * Debian 11 * [Download][download-linux-debian-11] the latest **netinst** release `.iso` image. (_e.g._ `debian-11.x.0-amd64-netinst.iso`) @@ -453,9 +450,9 @@ The files are distributed in the following directories. * Microsoft Windows 11 * Microsoft Windows 10 -1. Obtain the checksum type (_e.g.,_ `sha256`, `md5`, etc.) and checksum value for each guest operating system `.iso` image from the vendor. This will be use in the build input variables. +1. Obtain the checksum type (_e.g.,_ `sha256`, `md5`, etc.) and checksum value for each guest operating system `.iso` from the vendor. This will be use in the build input variables. -1. [Upload][vsphere-upload] your guest operating system `.iso` images to the ISO datastore and paths that will be used in your variables. +1. [Upload][vsphere-upload] or your guest operating system `.iso` files to the datastore and update the configuration variables, leaving the `iso_url` variable as `null`. **Example**: `config/common.pkvars.hcl` @@ -466,12 +463,25 @@ The files are distributed in the following directories. **Example**: `builds///*.auto.pkvars.hcl` ```hcl + iso_url = null iso_path = "iso/linux/photon" iso_file = "photon-4.0-xxxxxxxxx.iso" iso_checksum_type = "md5" iso_checksum_value = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` +#### Using a URL Source + +If you are using a URL source to obtain your guest operating system [`.iso`][iso] files, you must update the input variables to use the URL source. + +Update the `iso_url` variable to download the `.iso` from a URL. The `iso_url` variable takes presedence over any other `iso_*` variables. + + **Example**: `builds///*.auto.pkvars.hcl` + +```hcl +iso_url = "https://artifactory.rainpole.io/iso/linux/photon/4.0/x86_64/photon-4.0-xxxxxxxxx.iso" +``` + ### Step 3 - Configure Service Account Privileges in vSphere Create a custom vSphere role with the required privileges to integrate HashiCorp Packer with VMware vSphere. A service account can be added to the role to ensure that Packer has least privilege access to the infrastructure. Clone the default **Read-Only** vSphere role and add the following privileges: @@ -660,7 +670,8 @@ The content of the public key, `build_key`, is added the key to the `.ssh/author > **Warning** > -> Replace the default public keys and passwords. +> Replace the default public keys and passwords. +> > By default, both Public Key Authentication and Password Authentication are enabled for Linux distributions. If you wish to disable Password Authentication and only use Public Key Authentication, comment or remove the portion of the associated Ansible `configure` role. ##### Ansible Variables @@ -767,7 +778,7 @@ Edit the `config/proxy.pkvars.hcl` file to configure the following: ```hcl communicator_proxy_host = "proxy.rainpole.io" -communicator_proxy_port = 1080 +communicator_proxy_port = 8080 communicator_proxy_username = "rainpole" communicator_proxy_password = "" ``` diff --git a/builds/linux/almalinux/8/linux-almalinux.auto.pkrvars.hcl b/builds/linux/almalinux/8/linux-almalinux.auto.pkrvars.hcl index 146599ba2..291e54465 100644 --- a/builds/linux/almalinux/8/linux-almalinux.auto.pkrvars.hcl +++ b/builds/linux/almalinux/8/linux-almalinux.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/almalinux" iso_file = "AlmaLinux-8.6-x86_64-dvd.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/almalinux/8/linux-almalinux.pkr.hcl b/builds/linux/almalinux/8/linux-almalinux.pkr.hcl index 71666d539..6b75c0f1f 100644 --- a/builds/linux/almalinux/8/linux-almalinux.pkr.hcl +++ b/builds/linux/almalinux/8/linux-almalinux.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-almalinux" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/almalinux/8/variables.pkr.hcl b/builds/linux/almalinux/8/variables.pkr.hcl index 4ea9f8202..4cd3e6e93 100644 --- a/builds/linux/almalinux/8/variables.pkr.hcl +++ b/builds/linux/almalinux/8/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso'/linux/almalinux')" diff --git a/builds/linux/almalinux/9/linux-almalinux.auto.pkrvars.hcl b/builds/linux/almalinux/9/linux-almalinux.auto.pkrvars.hcl index 3bdf17d28..c0423b465 100644 --- a/builds/linux/almalinux/9/linux-almalinux.auto.pkrvars.hcl +++ b/builds/linux/almalinux/9/linux-almalinux.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/almalinux" iso_file = "AlmaLinux-9.0-x86_64-dvd.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/almalinux/9/linux-almalinux.pkr.hcl b/builds/linux/almalinux/9/linux-almalinux.pkr.hcl index 9c56afdad..92300b709 100644 --- a/builds/linux/almalinux/9/linux-almalinux.pkr.hcl +++ b/builds/linux/almalinux/9/linux-almalinux.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-almalinux" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/almalinux/9/variables.pkr.hcl b/builds/linux/almalinux/9/variables.pkr.hcl index 4d99758df..9de3f4eec 100644 --- a/builds/linux/almalinux/9/variables.pkr.hcl +++ b/builds/linux/almalinux/9/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso'/linux/almalinux')" diff --git a/builds/linux/centos/7/linux-centos.auto.pkrvars.hcl b/builds/linux/centos/7/linux-centos.auto.pkrvars.hcl index 95c1ffe63..8967d96f3 100644 --- a/builds/linux/centos/7/linux-centos.auto.pkrvars.hcl +++ b/builds/linux/centos/7/linux-centos.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/centos" iso_file = "CentOS-7-x86_64-DVD-2009.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/centos/7/linux-centos.pkr.hcl b/builds/linux/centos/7/linux-centos.pkr.hcl index 8bfecaf2c..7a06455ac 100644 --- a/builds/linux/centos/7/linux-centos.pkr.hcl +++ b/builds/linux/centos/7/linux-centos.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-centos" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/centos/7/variables.pkr.hcl b/builds/linux/centos/7/variables.pkr.hcl index f0bece1c7..1498317bd 100644 --- a/builds/linux/centos/7/variables.pkr.hcl +++ b/builds/linux/centos/7/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/centos')" diff --git a/builds/linux/centos/8-stream/linux-centos-stream.auto.pkrvars.hcl b/builds/linux/centos/8-stream/linux-centos-stream.auto.pkrvars.hcl index 4e22cb1a9..4273ff5d4 100644 --- a/builds/linux/centos/8-stream/linux-centos-stream.auto.pkrvars.hcl +++ b/builds/linux/centos/8-stream/linux-centos-stream.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/centos" iso_file = "CentOS-Stream-8-x86_64-latest-dvd1.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl b/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl index af290c270..84116938a 100644 --- a/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl +++ b/builds/linux/centos/8-stream/linux-centos-stream.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-centos-stream" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/centos/8-stream/variables.pkr.hcl b/builds/linux/centos/8-stream/variables.pkr.hcl index ba318dfd7..6ac314e27 100644 --- a/builds/linux/centos/8-stream/variables.pkr.hcl +++ b/builds/linux/centos/8-stream/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/centos')" diff --git a/builds/linux/centos/9-stream/linux-centos-stream.auto.pkrvars.hcl b/builds/linux/centos/9-stream/linux-centos-stream.auto.pkrvars.hcl index 494d09cf6..eea122ea9 100644 --- a/builds/linux/centos/9-stream/linux-centos-stream.auto.pkrvars.hcl +++ b/builds/linux/centos/9-stream/linux-centos-stream.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/centos" iso_file = "CentOS-Stream-9-latest-x86_64-dvd1.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl b/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl index e94751183..e025d72f7 100644 --- a/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl +++ b/builds/linux/centos/9-stream/linux-centos-stream.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-centos-stream" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/centos/9-stream/variables.pkr.hcl b/builds/linux/centos/9-stream/variables.pkr.hcl index 1c4b2caad..8133bdf89 100644 --- a/builds/linux/centos/9-stream/variables.pkr.hcl +++ b/builds/linux/centos/9-stream/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/centos')" diff --git a/builds/linux/debian/11/linux-debian.auto.pkrvars.hcl b/builds/linux/debian/11/linux-debian.auto.pkrvars.hcl index a64706363..f53b8fa8e 100644 --- a/builds/linux/debian/11/linux-debian.auto.pkrvars.hcl +++ b/builds/linux/debian/11/linux-debian.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = false vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/debian" iso_file = "debian-11.4.0-amd64-netinst.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/debian/11/linux-debian.pkr.hcl b/builds/linux/debian/11/linux-debian.pkr.hcl index ff729acfd..09f7568a9 100644 --- a/builds/linux/debian/11/linux-debian.pkr.hcl +++ b/builds/linux/debian/11/linux-debian.pkr.hcl @@ -20,9 +20,9 @@ packer { // Defines the local variables. locals { - build_by = "Built by: HashiCorp Packer ${packer.version}" - build_date = formatdate("YYYY-MM-DD hh:mm ZZZ", timestamp()) - build_version = formatdate("YY.MM", timestamp()) + build_by = "Built by: HashiCorp Packer ${packer.version}" + build_date = formatdate("YYYY-MM-DD hh:mm ZZZ", timestamp()) + build_version = formatdate("YY.MM", timestamp()) build_description = "Version: v${local.build_version}\nBuilt on: ${local.build_date}\n${local.build_by}" iso_paths = ["[${var.common_iso_datastore}] ${var.iso_path}/${var.iso_file}"] iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum_value}" @@ -85,8 +85,9 @@ source "vsphere-iso" "linux-debian" { notes = local.build_description // Removable Media Settings - iso_paths = local.iso_paths - iso_checksum = local.iso_checksum + iso_url = var.iso_url + iso_paths = local.iso_paths + iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null floppy_content = var.common_data_source == "disk" ? local.data_source_content : null @@ -133,7 +134,7 @@ source "vsphere-iso" "linux-debian" { skip_import = var.common_content_library_skip_export } } - + // OVF Export Settings dynamic "export" { for_each = var.common_ovf_export_enabled == true ? [1] : [] diff --git a/builds/linux/debian/11/variables.pkr.hcl b/builds/linux/debian/11/variables.pkr.hcl index 688fff061..c62ee578a 100644 --- a/builds/linux/debian/11/variables.pkr.hcl +++ b/builds/linux/debian/11/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/debian')" diff --git a/builds/linux/photon/4/linux-photon.auto.pkrvars.hcl b/builds/linux/photon/4/linux-photon.auto.pkrvars.hcl index 815f3c979..6287502ad 100644 --- a/builds/linux/photon/4/linux-photon.auto.pkrvars.hcl +++ b/builds/linux/photon/4/linux-photon.auto.pkrvars.hcl @@ -25,6 +25,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/photon" iso_file = "photon-4.0-c001795b8.iso" iso_checksum_type = "md5" @@ -36,4 +37,4 @@ vm_boot_wait = "2s" // Communicator Settings communicator_port = 22 -communicator_timeout = "30m" \ No newline at end of file +communicator_timeout = "30m" diff --git a/builds/linux/photon/4/linux-photon.pkr.hcl b/builds/linux/photon/4/linux-photon.pkr.hcl index 73c7763bb..0636f5cac 100644 --- a/builds/linux/photon/4/linux-photon.pkr.hcl +++ b/builds/linux/photon/4/linux-photon.pkr.hcl @@ -83,6 +83,7 @@ source "vsphere-iso" "linux-photon" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/photon/4/variables.pkr.hcl b/builds/linux/photon/4/variables.pkr.hcl index 51145f3f9..043b7cd11 100644 --- a/builds/linux/photon/4/variables.pkr.hcl +++ b/builds/linux/photon/4/variables.pkr.hcl @@ -212,6 +212,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/photon')" diff --git a/builds/linux/rhel/7/linux-rhel.auto.pkrvars.hcl b/builds/linux/rhel/7/linux-rhel.auto.pkrvars.hcl index dc80e3cff..5efe4c4c8 100644 --- a/builds/linux/rhel/7/linux-rhel.auto.pkrvars.hcl +++ b/builds/linux/rhel/7/linux-rhel.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/rhel" iso_file = "rhel-server-7.9-x86_64-dvd.iso" iso_checksum_type = "sha256" @@ -39,4 +40,4 @@ vm_boot_wait = "2s" // Communicator Settings communicator_port = 22 -communicator_timeout = "30m" \ No newline at end of file +communicator_timeout = "30m" diff --git a/builds/linux/rhel/7/linux-rhel.pkr.hcl b/builds/linux/rhel/7/linux-rhel.pkr.hcl index 5dc3dae5b..f3af0fff2 100644 --- a/builds/linux/rhel/7/linux-rhel.pkr.hcl +++ b/builds/linux/rhel/7/linux-rhel.pkr.hcl @@ -88,6 +88,7 @@ source "vsphere-iso" "linux-rhel" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/rhel/7/variables.pkr.hcl b/builds/linux/rhel/7/variables.pkr.hcl index 3fed314f2..26a0326fa 100644 --- a/builds/linux/rhel/7/variables.pkr.hcl +++ b/builds/linux/rhel/7/variables.pkr.hcl @@ -244,6 +244,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/rhel')" diff --git a/builds/linux/rhel/8/linux-rhel.auto.pkrvars.hcl b/builds/linux/rhel/8/linux-rhel.auto.pkrvars.hcl index fee8d285d..d63401ad1 100644 --- a/builds/linux/rhel/8/linux-rhel.auto.pkrvars.hcl +++ b/builds/linux/rhel/8/linux-rhel.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/rhel" iso_file = "rhel-8.6-x86_64-dvd.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/rhel/8/linux-rhel.pkr.hcl b/builds/linux/rhel/8/linux-rhel.pkr.hcl index 473818639..ba297bd24 100644 --- a/builds/linux/rhel/8/linux-rhel.pkr.hcl +++ b/builds/linux/rhel/8/linux-rhel.pkr.hcl @@ -88,6 +88,7 @@ source "vsphere-iso" "linux-rhel" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/rhel/8/variables.pkr.hcl b/builds/linux/rhel/8/variables.pkr.hcl index 394812b12..3452bec14 100644 --- a/builds/linux/rhel/8/variables.pkr.hcl +++ b/builds/linux/rhel/8/variables.pkr.hcl @@ -244,6 +244,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/rhel')" diff --git a/builds/linux/rhel/9/linux-rhel.auto.pkrvars.hcl b/builds/linux/rhel/9/linux-rhel.auto.pkrvars.hcl index 6812f9e81..043cf1d83 100644 --- a/builds/linux/rhel/9/linux-rhel.auto.pkrvars.hcl +++ b/builds/linux/rhel/9/linux-rhel.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/rhel" iso_file = "rhel-baseos-9.0-x86_64-dvd.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/rhel/9/linux-rhel.pkr.hcl b/builds/linux/rhel/9/linux-rhel.pkr.hcl index 1080830ea..c2e2c2294 100644 --- a/builds/linux/rhel/9/linux-rhel.pkr.hcl +++ b/builds/linux/rhel/9/linux-rhel.pkr.hcl @@ -88,6 +88,7 @@ source "vsphere-iso" "linux-rhel" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/rhel/9/variables.pkr.hcl b/builds/linux/rhel/9/variables.pkr.hcl index 832d17515..0e0268bb3 100644 --- a/builds/linux/rhel/9/variables.pkr.hcl +++ b/builds/linux/rhel/9/variables.pkr.hcl @@ -244,6 +244,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/rhel')" diff --git a/builds/linux/rocky/8/linux-rocky.auto.pkrvars.hcl b/builds/linux/rocky/8/linux-rocky.auto.pkrvars.hcl index 8150bd1e7..603a12236 100644 --- a/builds/linux/rocky/8/linux-rocky.auto.pkrvars.hcl +++ b/builds/linux/rocky/8/linux-rocky.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/rocky" iso_file = "Rocky-8.6-x86_64-dvd1.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/rocky/8/linux-rocky.pkr.hcl b/builds/linux/rocky/8/linux-rocky.pkr.hcl index 72df75f35..058ca0b14 100644 --- a/builds/linux/rocky/8/linux-rocky.pkr.hcl +++ b/builds/linux/rocky/8/linux-rocky.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-rocky" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/rocky/8/variables.pkr.hcl b/builds/linux/rocky/8/variables.pkr.hcl index 6af5df996..fef740ce6 100644 --- a/builds/linux/rocky/8/variables.pkr.hcl +++ b/builds/linux/rocky/8/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/rocky')" diff --git a/builds/linux/rocky/9/linux-rocky.auto.pkrvars.hcl b/builds/linux/rocky/9/linux-rocky.auto.pkrvars.hcl index bbd71a9df..4edb2b21e 100644 --- a/builds/linux/rocky/9/linux-rocky.auto.pkrvars.hcl +++ b/builds/linux/rocky/9/linux-rocky.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/rocky" iso_file = "Rocky-9.0-x86_64-dvd.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/rocky/9/linux-rocky.pkr.hcl b/builds/linux/rocky/9/linux-rocky.pkr.hcl index 0d2126cbd..1fec997bf 100644 --- a/builds/linux/rocky/9/linux-rocky.pkr.hcl +++ b/builds/linux/rocky/9/linux-rocky.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-rocky" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/rocky/9/variables.pkr.hcl b/builds/linux/rocky/9/variables.pkr.hcl index 9958f6da8..0ca8fa069 100644 --- a/builds/linux/rocky/9/variables.pkr.hcl +++ b/builds/linux/rocky/9/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/rocky')" diff --git a/builds/linux/sles/15/linux-sles.auto.pkrvars.hcl b/builds/linux/sles/15/linux-sles.auto.pkrvars.hcl index 99612dd07..36fdba57b 100644 --- a/builds/linux/sles/15/linux-sles.auto.pkrvars.hcl +++ b/builds/linux/sles/15/linux-sles.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/suse" iso_file = "SLE-15-SP3-Full-x86_64-GM-Media1.iso" iso_checksum_type = "sha256" diff --git a/builds/linux/sles/15/linux-sles.pkr.hcl b/builds/linux/sles/15/linux-sles.pkr.hcl index 691a51a34..5dd10b26e 100644 --- a/builds/linux/sles/15/linux-sles.pkr.hcl +++ b/builds/linux/sles/15/linux-sles.pkr.hcl @@ -20,14 +20,14 @@ packer { // Defines the local variables. locals { - build_by = "Built by: HashiCorp Packer ${packer.version}" - build_date = formatdate("YYYY-MM-DD hh:mm ZZZ", timestamp()) - build_version = formatdate("YY.MM", timestamp()) + build_by = "Built by: HashiCorp Packer ${packer.version}" + build_date = formatdate("YYYY-MM-DD hh:mm ZZZ", timestamp()) + build_version = formatdate("YY.MM", timestamp()) build_description = "Version: v${local.build_version}\nBuilt on: ${local.build_date}\n${local.build_by}" iso_paths = ["[${var.common_iso_datastore}] ${var.iso_path}/${var.iso_file}"] iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum_value}" - manifest_date = formatdate("YYYY-MM-DD hh:mm:ss", timestamp()) - manifest_path = "${path.cwd}/manifests/" + manifest_date = formatdate("YYYY-MM-DD hh:mm:ss", timestamp()) + manifest_path = "${path.cwd}/manifests/" manifest_output = "${local.manifest_path}${local.manifest_date}.json" ovf_export_path = "${path.cwd}/artifacts/${local.vm_name}" data_source_content = { @@ -65,7 +65,7 @@ source "vsphere-iso" "linux-sles" { // Virtual Machine Settings guest_os_type = var.vm_guest_os_type - vm_name = "${var.vm_guest_os_family}-${var.vm_guest_os_name}-${var.vm_guest_os_version}-v${local.build_version}" + vm_name = local.vm_name firmware = var.vm_firmware CPUs = var.vm_cpu_sockets cpu_cores = var.vm_cpu_cores @@ -85,11 +85,12 @@ source "vsphere-iso" "linux-sles" { vm_version = var.common_vm_version remove_cdrom = var.common_remove_cdrom tools_upgrade_policy = var.common_tools_upgrade_policy - notes = "Version: v${local.build_version}\nBuilt on: ${local.build_date}\n${local.build_by}" + notes = local.build_description // Removable Media Settings - iso_paths = ["[${var.common_iso_datastore}] ${var.iso_path}/${var.iso_file}"] - iso_checksum = "${var.iso_checksum_type}:${var.iso_checksum_value}" + iso_url = var.iso_url + iso_paths = local.iso_paths + iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null cd_content = var.common_data_source == "disk" ? local.data_source_content : null @@ -127,7 +128,7 @@ source "vsphere-iso" "linux-sles" { for_each = var.common_content_library_name != null ? [1] : [] content { library = var.common_content_library_name - description = "Version: v${local.build_version}\nBuilt on: ${local.build_date}\n${local.build_by}" + description = local.build_description ovf = var.common_content_library_ovf destroy = var.common_content_library_destroy skip_import = var.common_content_library_skip_export @@ -181,7 +182,6 @@ build { vsphere_datastore = var.vsphere_datastore vsphere_endpoint = var.vsphere_endpoint vsphere_folder = var.vsphere_folder - vsphere_iso_path = "[${var.common_iso_datastore}] ${var.iso_path}/${var.iso_file}" } } } diff --git a/builds/linux/sles/15/variables.pkr.hcl b/builds/linux/sles/15/variables.pkr.hcl index cc3919bf1..edb4fee21 100644 --- a/builds/linux/sles/15/variables.pkr.hcl +++ b/builds/linux/sles/15/variables.pkr.hcl @@ -244,6 +244,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/suse')" diff --git a/builds/linux/ubuntu/18-04-lts/linux-ubuntu.auto.pkrvars.hcl b/builds/linux/ubuntu/18-04-lts/linux-ubuntu.auto.pkrvars.hcl index 193af0151..a92547712 100644 --- a/builds/linux/ubuntu/18-04-lts/linux-ubuntu.auto.pkrvars.hcl +++ b/builds/linux/ubuntu/18-04-lts/linux-ubuntu.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/ubuntu" iso_file = "ubuntu-18.04.6-server-amd64.iso" iso_checksum_type = "sha256" @@ -39,4 +40,4 @@ vm_boot_wait = "3s" // Communicator Settings communicator_port = 22 -communicator_timeout = "30m" \ No newline at end of file +communicator_timeout = "30m" diff --git a/builds/linux/ubuntu/18-04-lts/linux-ubuntu.pkr.hcl b/builds/linux/ubuntu/18-04-lts/linux-ubuntu.pkr.hcl index 8f759a631..0daae0425 100644 --- a/builds/linux/ubuntu/18-04-lts/linux-ubuntu.pkr.hcl +++ b/builds/linux/ubuntu/18-04-lts/linux-ubuntu.pkr.hcl @@ -86,6 +86,7 @@ source "vsphere-iso" "linux-ubuntu" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/ubuntu/18-04-lts/variables.pkr.hcl b/builds/linux/ubuntu/18-04-lts/variables.pkr.hcl index f1551b030..617fcbf81 100644 --- a/builds/linux/ubuntu/18-04-lts/variables.pkr.hcl +++ b/builds/linux/ubuntu/18-04-lts/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/ubuntu')" diff --git a/builds/linux/ubuntu/20-04-lts/linux-ubuntu.auto.pkrvars.hcl b/builds/linux/ubuntu/20-04-lts/linux-ubuntu.auto.pkrvars.hcl index 3858c8692..09f7d11ee 100644 --- a/builds/linux/ubuntu/20-04-lts/linux-ubuntu.auto.pkrvars.hcl +++ b/builds/linux/ubuntu/20-04-lts/linux-ubuntu.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/ubuntu" iso_file = "ubuntu-20.04.4-live-server-amd64.iso" iso_checksum_type = "sha256" @@ -39,4 +40,4 @@ vm_boot_wait = "5s" // Communicator Settings communicator_port = 22 -communicator_timeout = "30m" \ No newline at end of file +communicator_timeout = "30m" diff --git a/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl b/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl index 2e2c5894b..8f9973e8f 100644 --- a/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl +++ b/builds/linux/ubuntu/20-04-lts/linux-ubuntu.pkr.hcl @@ -87,6 +87,7 @@ source "vsphere-iso" "linux-ubuntu" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl b/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl index 0b4b88bec..6e7079587 100644 --- a/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl +++ b/builds/linux/ubuntu/20-04-lts/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/ubuntu')" diff --git a/builds/linux/ubuntu/22-04-lts/linux-ubuntu.auto.pkrvars.hcl b/builds/linux/ubuntu/22-04-lts/linux-ubuntu.auto.pkrvars.hcl index 3a6f41122..baebbb42d 100644 --- a/builds/linux/ubuntu/22-04-lts/linux-ubuntu.auto.pkrvars.hcl +++ b/builds/linux/ubuntu/22-04-lts/linux-ubuntu.auto.pkrvars.hcl @@ -28,6 +28,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/linux/ubuntu" iso_file = "ubuntu-22.04-live-server-amd64.iso" iso_checksum_type = "sha256" @@ -39,4 +40,4 @@ vm_boot_wait = "5s" // Communicator Settings communicator_port = 22 -communicator_timeout = "30m" \ No newline at end of file +communicator_timeout = "30m" diff --git a/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl b/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl index d81522a51..b009d8019 100644 --- a/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl +++ b/builds/linux/ubuntu/22-04-lts/linux-ubuntu.pkr.hcl @@ -87,6 +87,7 @@ source "vsphere-iso" "linux-ubuntu" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum http_content = var.common_data_source == "http" ? local.data_source_content : null diff --git a/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl b/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl index b1c3fe30d..63fa8af3c 100644 --- a/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl +++ b/builds/linux/ubuntu/22-04-lts/variables.pkr.hcl @@ -230,6 +230,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/ubuntu')" diff --git a/builds/windows/desktop/10/variables.pkr.hcl b/builds/windows/desktop/10/variables.pkr.hcl index 2b6506d51..50d951bc9 100644 --- a/builds/windows/desktop/10/variables.pkr.hcl +++ b/builds/windows/desktop/10/variables.pkr.hcl @@ -271,6 +271,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/windows')" diff --git a/builds/windows/desktop/10/windows.auto.pkrvars.hcl b/builds/windows/desktop/10/windows.auto.pkrvars.hcl index 782b20745..1f3a326c7 100644 --- a/builds/windows/desktop/10/windows.auto.pkrvars.hcl +++ b/builds/windows/desktop/10/windows.auto.pkrvars.hcl @@ -37,6 +37,7 @@ vm_video_mem_size = 131072 vm_video_displays = 1 // Removable Media Settings +iso_url = null iso_path = "iso/windows/desktop" iso_file = "en-us_windows_10_business_editions_version_21h1_updated_sep_2021_x64_dvd_56628c48.iso" iso_checksum_type = "sha256" diff --git a/builds/windows/desktop/10/windows.pkr.hcl b/builds/windows/desktop/10/windows.pkr.hcl index eb77e289e..505d61b55 100644 --- a/builds/windows/desktop/10/windows.pkr.hcl +++ b/builds/windows/desktop/10/windows.pkr.hcl @@ -83,6 +83,7 @@ source "vsphere-iso" "windows-desktop" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ diff --git a/builds/windows/desktop/11/variables.pkr.hcl b/builds/windows/desktop/11/variables.pkr.hcl index 14063451e..84f774e5a 100644 --- a/builds/windows/desktop/11/variables.pkr.hcl +++ b/builds/windows/desktop/11/variables.pkr.hcl @@ -277,6 +277,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/windows')" diff --git a/builds/windows/desktop/11/windows.auto.pkrvars.hcl b/builds/windows/desktop/11/windows.auto.pkrvars.hcl index 39131f77a..c99467ed7 100644 --- a/builds/windows/desktop/11/windows.auto.pkrvars.hcl +++ b/builds/windows/desktop/11/windows.auto.pkrvars.hcl @@ -38,6 +38,7 @@ vm_video_mem_size = 131072 vm_video_displays = 1 // Removable Media Settings +iso_url = null iso_path = "iso/windows/desktop" iso_file = "en-us_windows_11_consumer_editions_updated_june_2022_x64_dvd_aec658b2.iso" iso_checksum_type = "sha256" diff --git a/builds/windows/desktop/11/windows.pkr.hcl b/builds/windows/desktop/11/windows.pkr.hcl index e65b89cd1..e767d3bee 100644 --- a/builds/windows/desktop/11/windows.pkr.hcl +++ b/builds/windows/desktop/11/windows.pkr.hcl @@ -84,6 +84,7 @@ source "vsphere-iso" "windows-desktop" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ diff --git a/builds/windows/server/2019/variables.pkr.hcl b/builds/windows/server/2019/variables.pkr.hcl index 153f0ddbb..7b4b3fd17 100644 --- a/builds/windows/server/2019/variables.pkr.hcl +++ b/builds/windows/server/2019/variables.pkr.hcl @@ -298,6 +298,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/windows')" diff --git a/builds/windows/server/2019/windows-server.auto.pkrvars.hcl b/builds/windows/server/2019/windows-server.auto.pkrvars.hcl index 02adfc161..4501adc9e 100644 --- a/builds/windows/server/2019/windows-server.auto.pkrvars.hcl +++ b/builds/windows/server/2019/windows-server.auto.pkrvars.hcl @@ -42,6 +42,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/windows/server" iso_file = "en-us_windows_server_2019_updated_aug_2021_x64_dvd_a6431a28.iso" iso_checksum_type = "sha256" @@ -63,4 +64,4 @@ inline = [ "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))", "choco feature enable -n allowGlobalConfirmation", "Get-EventLog -LogName * | ForEach { Clear-EventLog -LogName $_.Log }" -] \ No newline at end of file +] diff --git a/builds/windows/server/2019/windows-server.pkr.hcl b/builds/windows/server/2019/windows-server.pkr.hcl index d7c4a179b..c31cca800 100644 --- a/builds/windows/server/2019/windows-server.pkr.hcl +++ b/builds/windows/server/2019/windows-server.pkr.hcl @@ -84,6 +84,7 @@ source "vsphere-iso" "windows-server-standard-core" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ @@ -187,6 +188,7 @@ source "vsphere-iso" "windows-server-standard-desktop" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ @@ -290,6 +292,7 @@ source "vsphere-iso" "windows-server-datacenter-core" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ @@ -395,6 +398,7 @@ source "vsphere-iso" "windows-server-datacenter-desktop" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ diff --git a/builds/windows/server/2022/variables.pkr.hcl b/builds/windows/server/2022/variables.pkr.hcl index 6361ca982..dea0b3865 100644 --- a/builds/windows/server/2022/variables.pkr.hcl +++ b/builds/windows/server/2022/variables.pkr.hcl @@ -298,6 +298,11 @@ variable "common_iso_datastore" { description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" } +variable "iso_url" { + type = string + description = "The URL source of the ISO image. (e.g. 'https://artifactory.rainpole.io/.../os.iso')" +} + variable "iso_path" { type = string description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/windows')" diff --git a/builds/windows/server/2022/windows-server.auto.pkrvars.hcl b/builds/windows/server/2022/windows-server.auto.pkrvars.hcl index 0f0255619..bf3192a7b 100644 --- a/builds/windows/server/2022/windows-server.auto.pkrvars.hcl +++ b/builds/windows/server/2022/windows-server.auto.pkrvars.hcl @@ -42,6 +42,7 @@ vm_disk_thin_provisioned = true vm_network_card = "vmxnet3" // Removable Media Settings +iso_url = null iso_path = "iso/windows/server" iso_file = "en-us_windows_server_2022_updated_june_2022_x64_dvd_ac918027.iso" iso_checksum_type = "sha256" diff --git a/builds/windows/server/2022/windows-server.pkr.hcl b/builds/windows/server/2022/windows-server.pkr.hcl index d3dea08aa..c397f78e8 100644 --- a/builds/windows/server/2022/windows-server.pkr.hcl +++ b/builds/windows/server/2022/windows-server.pkr.hcl @@ -84,6 +84,7 @@ source "vsphere-iso" "windows-server-standard-core" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ @@ -187,6 +188,7 @@ source "vsphere-iso" "windows-server-standard-desktop" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ @@ -290,6 +292,7 @@ source "vsphere-iso" "windows-server-datacenter-core" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [ @@ -395,6 +398,7 @@ source "vsphere-iso" "windows-server-datacenter-desktop" { notes = local.build_description // Removable Media Settings + iso_url = var.iso_url iso_paths = local.iso_paths iso_checksum = local.iso_checksum cd_files = [