add esx5 build example

This commit is contained in:
Adrien Delorme 2020-07-09 17:44:33 +02:00
parent 8fc4e03139
commit 106ed314f6
3 changed files with 38 additions and 0 deletions

View File

@ -66,6 +66,14 @@ EOF
boot_command = local.ubuntu_1804_boot_command
}
source "source.vmware-iso.esxi-base-ubuntu-amd64" {
name = "16.04-from-esxi"
iso_url = local.iso_url_ubuntu_1604
iso_checksum = "file:${local.iso_checksum_url_ubuntu_1604}"
output_directory = "vmware_iso_ubuntu_1604_amd64_from_esxi"
boot_command = local.ubuntu_1604_boot_command
}
source "source.qemu.base-ubuntu-amd64" {
name = "16.04"
iso_url = local.iso_url_ubuntu_1604

View File

@ -0,0 +1,24 @@
source "vmware-iso" "esxi-base-ubuntu-amd64" {
headless = var.headless
boot_wait = "10s"
guest_os_type = "ubuntu-64"
http_directory = local.http_directory
shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now"
ssh_password = "vagrant"
ssh_port = 22
ssh_timeout = "10000s"
ssh_username = "vagrant"
tools_upload_flavor = "linux"
vmx_data = {
"cpuid.coresPerSocket" = "1"
"ethernet0.pciSlotNumber" = "32"
}
vmx_remove_ethernet_interfaces = true
remote_type = "esx5"
remote_host = var.esxi_host
remote_username = var.esxi_user
remote_password = var.esxi_password
remote_datastore = var.datastore
remote_private_key_file = var.remote_private_key_file_path
}

View File

@ -10,17 +10,23 @@
// export PKR_VAR_vcenter_user=""
// export PKR_VAR_vm_ip=""
// export PKR_VAR_gateway_ip=""
// ...
variable "vcenter_endpoint" { type = string }
variable "vcenter_user" { type = string }
variable "vcenter_password" { type = string }
variable "esxi_host" { type = string }
variable "esxi_password" { type = string }
variable "esxi_user" { type = string }
variable "datacenter_name" { type = string }
variable "vm_ip" { type = string }
variable "gateway_ip" { type = string }
variable "datastore" {
default = "datastore1"
}
variable "remote_private_key_file_path" {
type = string
}
source "vsphere-iso" "base-ubuntu-amd64" {
vcenter_server = var.vcenter_endpoint