-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
73 lines (63 loc) · 2.36 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
provider "vsphere" {
vsphere_server = var.vsphere_server
user = var.vsphere_user
password = var.vsphere_password
# Enable this if your vSphere server has a self-signed certificate
# allow_unverified_ssl = true
}
data "vsphere_datacenter" "dc" {
name = var.datacenter
}
data "vsphere_resource_pool" "resource_pool" {
name = var.resource_pool
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_datastore_cluster" "datastore_cluster" {
name = var.datastore_cluster
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_network" "network" {
name = var.network
datacenter_id = data.vsphere_datacenter.dc.id
}
data "vsphere_virtual_machine" "template_vm_linux" {
name = var.template_vm_linux
datacenter_id = data.vsphere_datacenter.dc.id
}
# data "vsphere_virtual_machine" "template_vm_windows" {
# name = ""
# datacenter_id = data.vsphere_datacenter.dc.id
# }
module "managers" {
source = "./modules/virtual_machine"
quantity = var.quantity_managers
name_prefix = "manager"
resource_pool_id = data.vsphere_resource_pool.resource_pool.id
datastore_cluster_id = data.vsphere_datastore_cluster.datastore_cluster.id
folder = var.folder
network_id = data.vsphere_network.network.id
template_vm = data.vsphere_virtual_machine.template_vm_linux
disk_size = 16
}
module "workers" {
source = "./modules/virtual_machine"
quantity = var.quantity_workers
name_prefix = "worker"
resource_pool_id = data.vsphere_resource_pool.resource_pool.id
datastore_cluster_id = data.vsphere_datastore_cluster.datastore_cluster.id
folder = var.folder
network_id = data.vsphere_network.network.id
template_vm = data.vsphere_virtual_machine.template_vm_linux
disk_size = 16
}
# module "workers_windows" {
# source = "./modules/virtual_machine"
# quantity = var.quantity_workers_windows
# name_prefix = "worker"
# resource_pool_id = data.vsphere_resource_pool.resource_pool.id
# datastore_cluster_id = data.vsphere_datastore_cluster.datastore_cluster.id
# folder = "Launchpad team"
# network_id = data.vsphere_network.network.id
# template_vm = data.vsphere_virtual_machine.template_windows
# disk_size = 16
# }