-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from Terraform-VMWare-Modules/rc/v2.0.0
v2.0.0
- Loading branch information
Showing
22 changed files
with
601 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# ChanegLog | ||
|
||
## v2.0.0 | ||
__New Variables__ | ||
```hcl | ||
variable "network" { | ||
description = "Define PortGroup and IPs for each VM" | ||
type = map(list(string)) | ||
default = {} | ||
} | ||
variable "data_disk" { | ||
description = "Storage data disk parameter, example" | ||
type = map(map(string)) | ||
default = {} | ||
} | ||
``` | ||
__Removed varsiables__ | ||
|
||
```hcl | ||
#Network Section | ||
variable "network_cards" { | ||
description = "" | ||
type = list(string) | ||
default = null | ||
} | ||
variable "ipv4" { | ||
description = "host(VM) IP address in map format, support more than one IP. Should correspond to number of instances." | ||
type = map | ||
default = {} | ||
} | ||
#Data Disk Section | ||
data "vsphere_datastore" "data_disk_datastore" { | ||
for_each = toset(var.data_disk_datastore) | ||
name = each.key | ||
datacenter_id = data.vsphere_datacenter.dc.id | ||
} | ||
variable "data_disk_label" { | ||
description = "Storage data disk labels." | ||
type = list | ||
default = [] | ||
} | ||
variable "data_disk_size_gb" { | ||
description = "List of Storage data disk size." | ||
type = list | ||
default = [] | ||
} | ||
variable "thin_provisioned" { | ||
description = "If true, this disk is thin provisioned, with space for the file being allocated on an as-needed basis." | ||
type = list | ||
default = null | ||
} | ||
variable "eagerly_scrub" { | ||
description = "if set to true, the disk space is zeroed out on VM creation. This will delay the creation of the disk or virtual machine. Cannot be set to true when thin_provisioned is true." | ||
type = list | ||
default = null | ||
} | ||
variable "data_disk_datastore" { | ||
description = "Define where the data disk should be stored, should be equal to number of defined data disks." | ||
type = list | ||
default = [] | ||
# validation { | ||
# condition = length(var.disk_datastore) == 0 || length(var.disk_datastore) == length(var.data_disk_size_gb) | ||
# error_message = "The list of disk datastore must be equal in length to disk_size_gb" | ||
# } | ||
} | ||
variable "data_disk_scsi_controller" { | ||
description = "scsi_controller number for the data disk, should be equal to number of defined data disk." | ||
type = list | ||
default = [] | ||
# validation { | ||
# condition = max(var.data_disk_scsi_controller...) < 4 && max(var.data_disk_scsi_controller...) > -1 | ||
# error_message = "The scsi_controller must be between 0 and 3" | ||
# } | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Terraform vSphere examples | ||
|
||
This directory contains various examples for deplpyong Linux/Windows VMs to a vSphere vCenter. | ||
|
||
## Getting started | ||
|
||
__Create a connection.tf file and copy the following code.__ | ||
|
||
```hcl | ||
# Configure the VMware vSphere Provider | ||
provider "vsphere" { | ||
user = "fill" | ||
password = "fill" | ||
vsphere_server = "fill" | ||
# if you have a self-signed cert | ||
allow_unverified_ssl = true | ||
} | ||
``` | ||
|
||
__Copy any of the exmpale tf files and fill the required data then run terraform init/plan/apply.__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module "example-server-windowsvm-advanced" { | ||
source = "Terraform-VMWare-Modules/vm/vsphere" | ||
version = "X.X.X" | ||
dc = "Datacenter" | ||
vmrp = "cluster/Resources" #Works with ESXi/Resources | ||
vmfolder = "Cattle" | ||
ds_cluster = "Datastore Cluster" #You can use datastore variable instead | ||
vmtemp = "TemplateName" | ||
instances = 2 | ||
vmname = "AdvancedVM" | ||
vmdomain = "somedomain.com" | ||
network = { | ||
"Name of the Port Group in vSphere" = ["10.13.113.2", "10.13.113.3"] # To use DHCP create Empty list ["",""] | ||
} | ||
data_disk = { | ||
disk1 = { | ||
size_gb = 30, | ||
thin_provisioned = false, | ||
data_disk_scsi_controller = 0, | ||
}, | ||
disk2 = { | ||
size_gb = 70, | ||
thin_provisioned = true, | ||
data_disk_scsi_controller = 1, | ||
datastore_id = "datastore-90679" | ||
} | ||
} | ||
scsi_bus_sharing = "physicalSharing" // The modes are physicalSharing, virtualSharing, and noSharing | ||
scsi_type = "lsilogic" // Other acceptable value "pvscsi" | ||
scsi_controller = 0 // This will assign OS disk to controller 0 | ||
vmdns = ["192.168.0.2", "192.168.0.1"] | ||
vmgateway = "192.168.0.1" | ||
enable_disk_uuid = true | ||
orgname = "Terraform-Module" | ||
workgroup = "Module-Test" | ||
is_windows_image = true | ||
firmware = "efi" | ||
local_adminpass = "Password@Strong" | ||
} |
Oops, something went wrong.