# vSphere settings
variable "vsphere_datacenter_name" {
  description = "Name of vSphere datacenter"
}

variable "vsphere_datastore_name" {
  description = "Name of vSphere datacenter for VM storage"
}

variable "vsphere_compute_cluster_name" {
  description = "Name of vSphere compute cluster"
  default     = ""
}

variable "vsphere_host" {
  description = "Name of host if using a standalone host, rather than a cluster. Only set if using a standalone host"
  default     = ""
}

variable "vsphere_network_name" {
  description = "Name of vSphere network for VM networking"
  default     = "VM Network"
}

variable "vm_template_name" {
  description = "Name of VM template used as base for VM"
  default     = "centos7_generic_template"
}

# VM settings
variable "vm_hostnames" {
  description = "A list of VM hostnames to provision"
  type        = list(string)
  default     = []
}

variable "vm_domain" {
  description = "Domain for VM network"
}

variable "vm_num_cpus" {
  default = 2
}

variable "vm_num_cores_per_socket" {
  default = 2
}

variable "vm_memory" {
  default = 2048
}

# VM update and custom settings
variable "vm_update_commands" {
  description = "Command or commands used to update newly provisioned system"
  type        = list(string)
  default     = [
    "sudo yum -y update",
  ]
}

variable "vm_custom_post_boot_commands" {
  description = "Custom commands to run on VM once provisioned and updated"
  type        = list(string)
  default     = [
    "date",
  ]
}

# Chef settings
variable "chef_bootstrap_script_path" {
  default = "~/chef-repo/knife_bootstrap_host.sh"
}

variable "chef_client_version" {
  default = "18.2.7"
}

variable "chef_bootstrap_script_additional_args" {
  description = "Additional arguments to pass to the Chef bootstrap script"
  default     = ""
}

variable "enable_disk_uuid" {
  description = "Exposes block device UUID to the VM"
  default     = false
  type        = bool
}

variable "extra_network_interfaces" {
  description = "extra network interfaces to add"
  type        = list(object({
    id           = string
    adapter_type = string
  }))
  default = []
}

# VM SSH settings
variable "ssh_user" {
  description = "User utilized by remote-exec for SSH access into VM"
  default     = "root"
}

variable "ssh_private_key_path" {
  description = "Private key for SSH access into VM"
  default     = "~/.ssh/id_rsa"
}

locals {
  ssh_private_key = file(var.ssh_private_key_path)
}

