-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathterraform-config.static.tf
More file actions
153 lines (143 loc) · 4.32 KB
/
terraform-config.static.tf
File metadata and controls
153 lines (143 loc) · 4.32 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#
# Apache v2 license
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
variable "wl_name" {
default = ""
}
variable "wl_namespace" {
default = ""
}
variable "wl_registry_map" {
default = ""
}
variable "intel_publisher_sut_machine_type" {
default = "static"
}
variable "intel_publisher_sut_metadata" {
default = ""
}
variable "worker_profile" {
default = {
vm_count = 1
hosts = {
"worker-0": {
# Note: Uncomment and specify your user name
# "user_name": "<user>",
"public_ip": "127.0.0.1",
"private_ip": "127.0.0.1",
"ssh_port": 22,
# Note: Support PDU for power measurement. Leave pdu_password empty.
# "pdu_port": "0",
# "pdu_group": "",
# "pdu_ip": "127.0.1.1",
# "pdu_user": "",
# "pdu_password": "",
# Note: Support BMC for power cycle SUT. Leave bmc_password empty.
# "bmc_ip": "127.0.0.1",
# "bmc_port": 623,
# "bmc_user": "<user>",
# "bmc_password": ""
# Note: Support Windows WINRM. Leave the winrm_password empty.
# "winrm_user": "<user>"
# "winrm_password": ""
# Specify passwords in script/csp/.static/config.json, support both global password or password by host ip
# {
# "winrm_password": "",
# "bmc_password": "",
# "pdu_password": "",
# "hosts": {
# "host_ip": {
# "pdu_password": "",
# "bmc_password": "",
# "winrm_password": ""
# }
# }
# }
},
}
}
}
variable "client_profile" {
default = {
vm_count = 1
hosts = {
"client-0": {
# Note: Uncomment and specify your user name
# "user_name": "<user>",
"public_ip": "127.0.0.1",
"private_ip": "127.0.0.1",
"ssh_port": 22,
# Note: Support PDU for power measurement. Leave pdu_password empty.
# "pdu_port": "0",
# "pdu_group": "",
# "pdu_ip": "127.0.1.1",
# "pdu_user": "",
# "pdu_password": "",
# Note: Support BMC for power cycle SUT. Leave bmc_password empty.
# "bmc_ip": "127.0.0.1",
# "bmc_port": 623,
# "bmc_user": "<user>",
# "bmc_password": ""
# Note: Support Windows WINRM. Leave the winrm_password empty.
# "winrm_user": "<user>"
# "winrm_password": ""
# Specify passwords in script/csp/.static/config.json:
# {
# "winrm_password": "",
# "bmc_password": "",
# "pdu_password": {
# "pdu_ip": {
# "pdu_user": ""
# }
# }
# }
},
}
}
}
variable "controller_profile" {
default = {
vm_count = 1
hosts = {
"controller-0": {
# Note: Uncomment and specify your user name
# "user_name": "<user>",
"public_ip": "127.0.0.1",
"private_ip": "127.0.0.1",
"ssh_port": 22,
}
}
}
}
output "instances" {
sensitive = true
value = merge({
for i in range(var.worker_profile.vm_count) :
"worker-${i}" => merge(var.worker_profile.hosts[var.worker_profile.hosts["worker-0"].public_ip=="127.0.0.1"?"worker-0":"worker-${i}"], var.worker_profile.hosts["worker-0"].public_ip=="127.0.0.1"?{
ansible_connection = "local"
}:{})
}, {
for i in range(var.client_profile.vm_count) :
"client-${i}" => merge(var.client_profile.hosts[var.client_profile.hosts["client-0"].public_ip=="127.0.0.1"?"client-0":"client-${i}"], var.client_profile.hosts["client-0"].public_ip=="127.0.0.1"?{
ansible_connection = "local"
}:{})
}, {
for i in range(var.controller_profile.vm_count) :
"controller-${i}" => merge(var.controller_profile.hosts["controller-${i}"], var.controller_profile.hosts["controller-0"].public_ip=="127.0.0.1"?{
ansible_connection = "local"
}:{})
})
}
output "options" {
value = {
wl_name : var.wl_name,
wl_registry_map : var.wl_registry_map,
wl_namespace : var.wl_namespace,
intel_publisher_sut_machine_type: var.intel_publisher_sut_machine_type,
intel_publisher_sut_metadata: var.intel_publisher_sut_metadata,
# Enable k8s registry only in the DDCW use case. See doc/user-guide/preparing-infrastructure/setup-wsf.md
k8s_enable_registry: false,
}
}