From d7aedae3c9b8a11519b3e24fe1ef987cdaa39b1a Mon Sep 17 00:00:00 2001 From: Giovanni Pellerano Date: Mon, 11 Apr 2022 12:56:20 +0200 Subject: [PATCH] Add Debian/Linux 11 machine image --- README.md | 1 + build.sh | 37 +- builds/linux/debian/11/data/ks.pkrtpl.hcl | 178 +++++++++ .../debian/11/linux-debian.auto.pkrvars.hcl | 42 +++ builds/linux/debian/11/linux-debian.pkr.hcl | 180 +++++++++ builds/linux/debian/11/variables.pkr.hcl | 356 ++++++++++++++++++ 6 files changed, 792 insertions(+), 2 deletions(-) create mode 100644 builds/linux/debian/11/data/ks.pkrtpl.hcl create mode 100644 builds/linux/debian/11/linux-debian.auto.pkrvars.hcl create mode 100644 builds/linux/debian/11/linux-debian.pkr.hcl create mode 100644 builds/linux/debian/11/variables.pkr.hcl diff --git a/README.md b/README.md index 1998ee477..430f2eb97 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ The following builds are available: **Linux Distributions** * VMware Photon OS 4 +* Debian 11 * Ubuntu Server 22.04 LTS * Ubuntu Server 20.04 LTS * Ubuntu Server 18.04 LTS diff --git a/build.sh b/build.sh index 373c1e77a..3e947b947 100755 --- a/build.sh +++ b/build.sh @@ -19,7 +19,7 @@ follow_link() { SCRIPT_PATH=$(realpath "$(dirname "$(follow_link "$0")")") CONFIG_PATH=$(realpath "${1:-${SCRIPT_PATH}/config}") -menu_option_1() { +menu_option_0() { INPUT_PATH="$SCRIPT_PATH"/builds/linux/photon/4/ echo -e "\nCONFIRM: Build a VMware Photon OS 4 Template for VMware vSphere?" echo -e "\nContinue? (y/n)" @@ -50,6 +50,37 @@ menu_option_1() { echo "Done." } +menu_option_1() { + INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/11/ + echo -e "\nCONFIRM: Build a Debian Bullseye 11 Template for VMware vSphere?" + echo -e "\nContinue? (y/n)" + read -r REPLY + if [[ ! $REPLY =~ ^[Yy]$ ]] + then + exit 1 + fi + + ### Build a Debian Bullseye 11 Template for VMware vSphere. ### + echo "Building a Debian Bullseye 11 Template for VMware vSphere..." + + ### Initialize HashiCorp Packer and required plugins. ### + echo "Initializing HashiCorp Packer and required plugins..." + packer init "$INPUT_PATH" + + ### Start the Build. ### + echo "Starting the build...." + packer build -force \ + -var-file="$CONFIG_PATH/vsphere.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/build.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/proxy.pkrvars.hcl" \ + -var-file="$CONFIG_PATH/common.pkrvars.hcl" \ + "$INPUT_PATH" + + ### All done. ### + echo "Done." +} + menu_option_2() { INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/22-04-lts/ echo -e "\nCONFIRM: Build a Ubuntu Server 22.04 LTS Beta Template for VMware vSphere?" @@ -721,7 +752,8 @@ until [ "$selection" = "0" ]; do echo "" echo " Linux Distribution:" echo "" - echo " 1 - VMware Photon OS 4" + echo " 0 - VMware Photon OS 4" + echo " 1 - Debian 11" echo " 2 - Ubuntu Server 22.04 LTS Beta" echo " 3 - Ubuntu Server 20.04 LTS" echo " 4 - Ubuntu Server 18.04 LTS" @@ -755,6 +787,7 @@ until [ "$selection" = "0" ]; do read -r selection echo "" case $selection in + 0 ) clear ; menu_option_0 ; press_enter ;; 1 ) clear ; menu_option_1 ; press_enter ;; 2 ) clear ; menu_option_2 ; press_enter ;; 3 ) clear ; menu_option_3 ; press_enter ;; diff --git a/builds/linux/debian/11/data/ks.pkrtpl.hcl b/builds/linux/debian/11/data/ks.pkrtpl.hcl new file mode 100644 index 000000000..5cabb1472 --- /dev/null +++ b/builds/linux/debian/11/data/ks.pkrtpl.hcl @@ -0,0 +1,178 @@ +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Debian 11 + +# Locale and Keyboard +d-i debian-installer/locale string ${vm_guest_os_language} +d-i keyboard-configuration/xkb-keymap select ${vm_guest_os_keyboard} + +# Clock and Timezone +d-i clock-setup/utc boolean true +d-i clock-setup/ntp boolean true +d-i time/zone string ${vm_guest_os_timezone} + +# Grub and Reboot Message +d-i finish-install/reboot_in_progress note +d-i grub-installer/only_debian boolean true + +# Partitioning +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman-auto-lvm/new_vg_name string sysvg +d-i partman-efi/non_efi_system boolean true + +d-i partman-auto/expert_recipe string \ + custom :: \ + 1024 1024 1024 fat32 \ + $primary{ } \ + mountpoint{ /boot/efi } \ + method{ efi } \ + format{ } \ + use_filesystem{ } \ + filesystem{ vfat } \ + label { EFIFS } \ + . \ + 1024 1024 1024 xfs \ + $bootable{ } \ + $primary{ } \ + mountpoint{ /boot } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { BOOTFS } \ + . \ + 1024 1024 1024 linux-swap \ + $lvmok{ } \ + lv_name{ lv_swap } \ + in_vg { sysvg } \ + method{ swap } \ + format{ } \ + label { SWAPFS } \ + . \ + 12288 12288 -1 xfs \ + $lvmok{ } \ + mountpoint{ / } \ + lv_name{ lv_root } \ + in_vg { sysvg } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { ROOTFS } \ + . \ + 4096 4096 4096 xfs \ + $lvmok{ } \ + mountpoint{ /home } \ + lv_name{ lv_home } \ + in_vg { sysvg } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { HOMEFS } \ + options/nodev{ nodev } \ + options/nosuid{ nosuid } \ + . \ + 2048 2048 2048 xfs \ + $lvmok{ } \ + mountpoint{ /opt } \ + lv_name{ lv_opt } \ + in_vg { sysvg } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { OPTFS } \ + options/nodev{ nodev } \ + . \ + 3072 3072 3072 xfs \ + $lvmok{ } \ + mountpoint{ /tmp } \ + lv_name{ lv_tmp } \ + in_vg { sysvg } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { TMPFS } \ + options/nodev{ nodev } \ + options/noexec{ noexec } \ + options/nosuid{ nosuid } \ + . \ + 4096 4096 4096 xfs \ + $lvmok{ } \ + mountpoint{ /var } \ + lv_name{ lv_var } \ + in_vg { sysvg } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { VARFS } \ + options/nodev{ nodev } \ + . \ + 4096 4096 4096 xfs \ + $lvmok{ } \ + mountpoint{ /var/log } \ + lv_name{ lv_log } \ + in_vg { sysvg } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { LOGFS } \ + options/nodev{ nodev } \ + options/noexec{ noexec } \ + options/nosuid{ nosuid } \ + . \ + 4096 4096 4096 xfs \ + $lvmok{ } \ + mountpoint{ /var/log/audit } \ + lv_name{ lv_audit } \ + in_vg { sysvg } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ xfs } \ + label { AUDITFS } \ + options/nodev{ nodev } \ + options/noexec{ noexec } \ + options/nosuid{ nosuid } \ + . \ + +d-i partman-partitioning/confirm_write_new_label boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + +# Network configuration +d-i netcfg/choose_interface select auto +d-i netcfg/get_hostname string unassigned-hostname +d-i netcfg/get_domain string unassigned-domain + +# Mirror settings +d-i mirror/country string manual +d-i mirror/http/hostname string ftp.it.debian.org +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# User Configuration +d-i passwd/root-login boolean false +d-i passwd/user-fullname string ${build_username} +d-i passwd/username string ${build_username} +d-i passwd/user-password-crypted password ${build_password_encrypted} + +# Package Configuration +d-i pkgsel/run_tasksel boolean false +d-i pkgsel/include string openssh-server open-vm-tools + +# Add User to Sudoers +d-i preseed/late_command string \ + echo '${build_username} ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/${build_username} ; \ + in-target chmod 440 /etc/sudoers.d/${build_username} ; diff --git a/builds/linux/debian/11/linux-debian.auto.pkrvars.hcl b/builds/linux/debian/11/linux-debian.auto.pkrvars.hcl new file mode 100644 index 000000000..2fe402f8d --- /dev/null +++ b/builds/linux/debian/11/linux-debian.auto.pkrvars.hcl @@ -0,0 +1,42 @@ +/* + DESCRIPTION: + Debian 11 variables used by the Packer Plugin for VMware vSphere (vsphere-iso). +*/ + +// Guest Operating System Metadata +vm_guest_os_language = "en_US" +vm_guest_os_keyboard = "us" +vm_guest_os_timezone = "UTC" +vm_guest_os_family = "linux" +vm_guest_os_name = "debian" +vm_guest_os_version = "11" + +// Virtual Machine Guest Operating System Setting +vm_guest_os_type = "debian11_64Guest" + +// Virtual Machine Hardware Settings +vm_firmware = "efi-secure" +vm_cdrom_type = "sata" +vm_cpu_sockets = 2 +vm_cpu_cores = 1 +vm_cpu_hot_add = false +vm_mem_size = 2048 +vm_mem_hot_add = false +vm_disk_size = 40960 +vm_disk_controller_type = ["pvscsi"] +vm_disk_thin_provisioned = false +vm_network_card = "vmxnet3" + +// Removable Media Settings +iso_path = "iso/linux/debian" +iso_file = "debian-11.3.0-amd64-netinst.iso" +iso_checksum_type = "sha256" +iso_checksum_value = "7892981e1da216e79fb3a1536ce5ebab157afdd20048fe458f2ae34fbc26c19b" + +// Boot Settings +vm_boot_order = "disk,cdrom" +vm_boot_wait = "5s" + +// Communicator Settings +communicator_port = 22 +communicator_timeout = "30m" diff --git a/builds/linux/debian/11/linux-debian.pkr.hcl b/builds/linux/debian/11/linux-debian.pkr.hcl new file mode 100644 index 000000000..cc55dcd41 --- /dev/null +++ b/builds/linux/debian/11/linux-debian.pkr.hcl @@ -0,0 +1,180 @@ +/* + DESCRIPTION: + Debian Linux 11 template using the Packer Builder for VMware vSphere (vsphere-iso). +*/ + +// BLOCK: packer +// The Packer configuration. + +packer { + required_version = ">= 1.8.0" + required_plugins { + vsphere = { + version = ">= v1.0.3" + source = "github.com/hashicorp/vsphere" + } + } +} + +// BLOCK: locals +// 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()) + manifest_date = formatdate("YYYY-MM-DD hh:mm:ss", timestamp()) + manifest_path = "${path.cwd}/manifests/" + data_source_content = { + "/ks.cfg" = templatefile("${abspath(path.root)}/data/ks.pkrtpl.hcl", { + build_username = var.build_username + build_password_encrypted = var.build_password_encrypted + vm_guest_os_language = var.vm_guest_os_language + vm_guest_os_keyboard = var.vm_guest_os_keyboard + vm_guest_os_timezone = var.vm_guest_os_timezone + }) + } +} + +// BLOCK: source +// Defines the builder configuration blocks. + +source "vsphere-iso" "linux-debian" { + + // vCenter Server Endpoint Settings and Credentials + vcenter_server = var.vsphere_endpoint + username = var.vsphere_username + password = var.vsphere_password + insecure_connection = var.vsphere_insecure_connection + + // vSphere Settings + datacenter = var.vsphere_datacenter + cluster = var.vsphere_cluster + datastore = var.vsphere_datastore + folder = var.vsphere_folder + + // 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}" + firmware = var.vm_firmware + CPUs = var.vm_cpu_sockets + cpu_cores = var.vm_cpu_cores + CPU_hot_plug = var.vm_cpu_hot_add + RAM = var.vm_mem_size + RAM_hot_plug = var.vm_mem_hot_add + cdrom_type = var.vm_cdrom_type + disk_controller_type = var.vm_disk_controller_type + storage { + disk_size = var.vm_disk_size + disk_thin_provisioned = var.vm_disk_thin_provisioned + } + network_adapters { + network = var.vsphere_network + network_card = var.vm_network_card + } + 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}" + + // 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}" + http_content = var.common_data_source == "http" ? local.data_source_content : null + cd_content = var.common_data_source == "disk" ? local.data_source_content : null + cd_label = var.common_data_source == "disk" ? "cidata" : null + + // Boot and Provisioning Settings + http_ip = var.common_data_source == "http" ? var.common_http_ip : null + http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null + http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null + boot_order = var.vm_boot_order + boot_wait = var.vm_boot_wait + boot_command = [ + "c", + "linux /install.amd/vmlinuz", + " auto-install/enable=true", + " debconf/priority=critical", + " url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg", + " noprompt --", + "initrd /install.amd/initrd.gz", + "boot" + ] + ip_wait_timeout = var.common_ip_wait_timeout + shutdown_command = "echo '${var.build_password}' | sudo -S -E shutdown -P now" + shutdown_timeout = var.common_shutdown_timeout + + // Communicator Settings and Credentials + communicator = "ssh" + ssh_proxy_host = var.communicator_proxy_host + ssh_proxy_port = var.communicator_proxy_port + ssh_proxy_username = var.communicator_proxy_username + ssh_proxy_password = var.communicator_proxy_password + ssh_username = var.build_username + ssh_password = var.build_password + ssh_port = var.communicator_port + ssh_timeout = var.communicator_timeout + + // Template and Content Library Settings + convert_to_template = var.common_template_conversion + dynamic "content_library_destination" { + 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}" + ovf = var.common_content_library_ovf + destroy = var.common_content_library_destroy + skip_import = var.common_content_library_skip_export + } + } +} + +// BLOCK: build +// Defines the builders to run, provisioners, and post-processors. + +build { + sources = ["source.vsphere-iso.linux-debian"] + + provisioner "ansible" { + playbook_file = "${path.cwd}/ansible/main.yml" + roles_path = "${path.cwd}/ansible/roles" + ansible_env_vars = [ + "ANSIBLE_CONFIG=${path.cwd}/ansible/ansible.cfg" + ] + extra_arguments = [ + "--extra-vars", "display_skipped_hosts=false", + "--extra-vars", "BUILD_USERNAME=${var.build_username}", + "--extra-vars", "BUILD_SECRET='${var.build_key}'", + "--extra-vars", "ANSIBLE_USERNAME=${var.ansible_username}", + "--extra-vars", "ANSIBLE_SECRET='${var.ansible_key}'", + ] + } + + post-processor "manifest" { + output = "${local.manifest_path}${local.manifest_date}.json" + strip_path = true + strip_time = true + custom_data = { + ansible_username = var.ansible_username + build_username = var.build_username + build_date = local.build_date + build_version = local.build_version + common_data_source = var.common_data_source + common_vm_version = var.common_vm_version + vm_cpu_cores = var.vm_cpu_cores + vm_cpu_sockets = var.vm_cpu_sockets + vm_disk_size = var.vm_disk_size + vm_disk_thin_provisioned = var.vm_disk_thin_provisioned + vm_firmware = var.vm_firmware + vm_guest_os_type = var.vm_guest_os_type + vm_mem_size = var.vm_mem_size + vm_network_card = var.vm_network_card + vsphere_cluster = var.vsphere_cluster + vsphere_datacenter = var.vsphere_datacenter + 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/debian/11/variables.pkr.hcl b/builds/linux/debian/11/variables.pkr.hcl new file mode 100644 index 000000000..8e295b87d --- /dev/null +++ b/builds/linux/debian/11/variables.pkr.hcl @@ -0,0 +1,356 @@ +/* + DESCRIPTION: + Debian 11 variables using the Packer Builder for VMware vSphere (vsphere-iso). +*/ + +// BLOCK: variable +// Defines the input variables. + +// vSphere Credentials + +variable "vsphere_endpoint" { + type = string + description = "The fully qualified domain name or IP address of the vCenter Server instance. (e.g. 'sfo-w01-vc01.sfo.rainpole.io')" +} + +variable "vsphere_username" { + type = string + description = "The username to login to the vCenter Server instance. (e.g. 'svc-packer-vsphere@rainpole.io')" + sensitive = true +} + +variable "vsphere_password" { + type = string + description = "The password for the login to the vCenter Server instance." + sensitive = true +} + +variable "vsphere_insecure_connection" { + type = bool + description = "Do not validate vCenter Server TLS certificate." + default = true +} + +// vSphere Settings + +variable "vsphere_datacenter" { + type = string + description = "The name of the target vSphere datacenter. (e.g. 'sfo-w01-dc01')" +} + +variable "vsphere_cluster" { + type = string + description = "The name of the target vSphere cluster. (e.g. 'sfo-w01-cl01')" +} + +variable "vsphere_datastore" { + type = string + description = "The name of the target vSphere datastore. (e.g. 'sfo-w01-cl01-vsan01')" +} + +variable "vsphere_network" { + type = string + description = "The name of the target vSphere network segment. (e.g. 'sfo-w01-dhcp')" +} + +variable "vsphere_folder" { + type = string + description = "The name of the target vSphere cluster. (e.g. 'sfo-w01-fd-templates')" +} + +// Virtual Machine Settings + +variable "vm_guest_os_language" { + type = string + description = "The guest operating system lanugage." + default = "en_US" +} + +variable "vm_guest_os_keyboard" { + type = string + description = "The guest operating system keyboard input." + default = "us" +} + +variable "vm_guest_os_timezone" { + type = string + description = "The guest operating system timezone." + default = "UTC" +} + +variable "vm_guest_os_family" { + type = string + description = "The guest operating system family. Used for naming. (e.g. 'linux')" +} + +variable "vm_guest_os_name" { + type = string + description = "The guest operating system name. Used for naming . (e.g. 'debian')" +} + +variable "vm_guest_os_version" { + type = string + description = "The guest operating system version. Used for naming. (e.g. '11')" +} + +variable "vm_guest_os_type" { + type = string + description = "The guest operating system type, also know as guestid. (e.g. 'debian64Guest')" +} + +variable "vm_firmware" { + type = string + description = "The virtual machine firmware. (e.g. 'efi-secure'. 'efi', or 'bios')" + default = "efi-secure" +} + +variable "vm_cdrom_type" { + type = string + description = "The virtual machine CD-ROM type. (e.g. 'sata', or 'ide')" + default = "sata" +} + +variable "vm_cpu_sockets" { + type = number + description = "The number of virtual CPUs sockets. (e.g. '2')" +} + +variable "vm_cpu_cores" { + type = number + description = "The number of virtual CPUs cores per socket. (e.g. '1')" +} + +variable "vm_cpu_hot_add" { + type = bool + description = "Enable hot add CPU." + default = false +} + +variable "vm_mem_size" { + type = number + description = "The size for the virtual memory in MB. (e.g. '2048')" +} + +variable "vm_mem_hot_add" { + type = bool + description = "Enable hot add memory." + default = false +} + +variable "vm_disk_size" { + type = number + description = "The size for the virtual disk in MB. (e.g. '40960')" +} + +variable "vm_disk_controller_type" { + type = list(string) + description = "The virtual disk controller types in sequence. (e.g. 'pvscsi')" + default = ["pvscsi"] +} + +variable "vm_disk_thin_provisioned" { + type = bool + description = "Thin provision the virtual disk." + default = true +} + +variable "vm_network_card" { + type = string + description = "The virtual network card type. (e.g. 'vmxnet3' or 'e1000e')" + default = "vmxnet3" +} + +variable "common_vm_version" { + type = number + description = "The vSphere virtual hardware version. (e.g. '19')" +} + +variable "common_tools_upgrade_policy" { + type = bool + description = "Upgrade VMware Tools on reboot." + default = true +} + +variable "common_remove_cdrom" { + type = bool + description = "Remove the virtual CD-ROM(s)." + default = true +} + +// Template and Content Library Settings + +variable "common_template_conversion" { + type = bool + description = "Convert the virtual machine to template. Must be 'false' for content library." + default = false +} + +variable "common_content_library_name" { + type = string + description = "The name of the target vSphere content library, if used. (e.g. 'sfo-w01-cl01-lib01')" + default = null +} + +variable "common_content_library_ovf" { + type = bool + description = "Export to content library as an OVF template." + default = true +} + +variable "common_content_library_destroy" { + type = bool + description = "Delete the virtual machine after exporting to the content library." + default = true +} + +variable "common_content_library_skip_export" { + type = bool + description = "Skip exporting the virtual machine to the content library. Option allows for testing / debugging without saving the machine image." + default = false +} + +// Removable Media Settings + +variable "common_iso_datastore" { + type = string + description = "The name of the source vSphere datastore for ISO images. (e.g. 'sfo-w01-cl01-nfs01')" +} + +variable "iso_path" { + type = string + description = "The path on the source vSphere datastore for ISO image. (e.g. 'iso/linux/debian')" +} + +variable "iso_file" { + type = string + description = "The file name of the ISO image used by the vendor. (e.g. 'debian--amd64-netinst.iso')" +} + +variable "iso_checksum_type" { + type = string + description = "The checksum algorithm used by the vendor. (e.g. 'sha256')" +} + +variable "iso_checksum_value" { + type = string + description = "The checksum value provided by the vendor." +} + +// Boot Settings + +variable "common_data_source" { + type = string + description = "The provisioning data source. (e.g. 'http' or 'disk')" +} + +variable "common_http_ip" { + type = string + description = "Define an IP address on the host to use for the HTTP server." + default = null +} + +variable "common_http_port_min" { + type = number + description = "The start of the HTTP port range." +} + +variable "common_http_port_max" { + type = number + description = "The end of the HTTP port range." +} + +variable "vm_boot_order" { + type = string + description = "The boot order for virtual machines devices. (e.g. 'disk,cdrom')" + default = "disk,cdrom" +} + +variable "vm_boot_wait" { + type = string + description = "The time to wait before boot." +} + +variable "common_ip_wait_timeout" { + type = string + description = "Time to wait for guest operating system IP address response." +} + +variable "common_shutdown_timeout" { + type = string + description = "Time to wait for guest operating system shutdown." +} + +// Communicator Settings and Credentials + +variable "build_username" { + type = string + description = "The username to login to the guest operating system. (e.g. 'rainpole')" + sensitive = true +} + +variable "build_password" { + type = string + description = "The password to login to the guest operating system." + sensitive = true +} + +variable "build_password_encrypted" { + type = string + description = "The encrypted password to login the guest operating system." + sensitive = true +} + +variable "build_key" { + type = string + description = "The public key to login to the guest operating system." + sensitive = true +} + +variable "communicator_proxy_host" { + type = string + description = "A SOCKS proxy host to use for SSH connection." + default = null +} + +variable "communicator_proxy_port" { + type = number + description = "A port of the SOCKS proxy." + default = null +} + +variable "communicator_proxy_username" { + type = string + description = "The optional username to authenticate with the proxy server." + default = null +} + +variable "communicator_proxy_password" { + type = string + description = "The optional password to use to authenticate with the proxy server." + sensitive = true + default = null +} + +variable "communicator_port" { + type = string + description = "The port for the communicator protocol." +} + +variable "communicator_timeout" { + type = string + description = "The timeout for the communicator protocol." +} + +// Ansible Credentials + +variable "ansible_username" { + type = string + description = "The username for Ansible to login to the guest operating system. (e.g. 'ansible')" + sensitive = true +} + +variable "ansible_key" { + type = string + description = "The public key for Ansible to login to the guest operating system." + sensitive = true +}