-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmain.tf
90 lines (81 loc) · 1.95 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Required Provider
terraform {
required_providers {
vcf = {
source = "vmware/vcf"
}
}
}
# Provider Configuration
provider "vcf" {
sddc_manager_username = var.sddc_manager_username
sddc_manager_password = var.sddc_manager_password
sddc_manager_host = var.sddc_manager_host
}
# Resources
resource "vcf_ceip" "ceip" {
status = "DISABLE"
}
resource "vcf_user" "testuser1" {
name = "[email protected]"
domain = "vrack.vsphere.local"
type = "USER"
role_name = "VIEWER"
}
resource "vcf_user" "serviceuser1" {
name = "serviceuser1"
domain = "Nil"
type = "SERVICE"
role_name = "ADMIN"
}
output "serviceuser1_apikey" {
value = vcf_user.serviceuser1.api_key
}
resource "vcf_network_pool" "eng_pool" {
name = "engineering-pool2"
network {
gateway = "192.168.8.1"
mask = "255.255.255.0"
mtu = 9000
subnet = "192.168.8.0"
type = "VSAN"
vlan_id = 100
ip_pools {
start = "192.168.8.5"
end = "192.168.8.50"
}
}
network {
gateway = "192.168.9.1"
mask = "255.255.255.0"
mtu = 9000
subnet = "192.168.9.0"
type = "vMotion"
vlan_id = 100
ip_pools {
start = "192.168.9.5"
end = "192.168.9.50"
}
}
}
resource "vcf_host" "esxi_1" {
fqdn = "esxi-1.vrack.vsphere.local"
username = var.esxi_1_user
password = var.esxi_1_pass
network_pool_name = "bringup-networkpool"
storage_type = "VSAN"
}
resource "vcf_host" "esxi_2" {
fqdn = "esxi-2.vrack.vsphere.local"
username = var.esxi_2_user
password = var.esxi_2_pass
network_pool_name = "bringup-networkpool"
storage_type = "VSAN"
}
resource "vcf_host" "esxi_3" {
fqdn = "esxi-3.vrack.vsphere.local"
username = var.esxi_3_user
password = var.esxi_3_pass
network_pool_name = "bringup-networkpool"
storage_type = "VSAN"
}