-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvariables.tf
273 lines (232 loc) · 7.68 KB
/
variables.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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
################################################################
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Licensed Materials - Property of IBM
#
# ©Copyright IBM Corp. 2022
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################
################################################################
# Configure the IBM Cloud provider
################################################################
variable "ibmcloud_api_key" {
description = "IBM Cloud API key associated with user's identity"
default = "<key>"
}
variable "service_instance_id" {
description = "The cloud instance ID of your account"
default = ""
}
variable "ibmcloud_region" {
description = "The IBM Cloud region where you want to create the resources"
default = ""
}
variable "ibmcloud_zone" {
description = "The zone of an IBM Cloud region where you want to create Power System resources"
default = ""
}
################################################################
# Configure the Instance details
################################################################
variable "bastion" {
# only one node is supported
default = {
count = 1
memory = "16"
processors = "1"
}
validation {
condition = lookup(var.bastion, "count", 1) == 1
error_message = "The bastion.count value must be either 1 or 2."
}
}
variable "bastion_public_ip" {
type = string
description = "The bastion_public_ip is the IP used to deploy the NBDE servers when the bastion.count = 0, and uses a pre-existing bastion host"
default = ""
}
variable "tang" {
# only three nodes are supported
default = {
count = 3
memory = "16"
processors = "1"
data_volume_size = 10 # Default volume size (in GB) to be attached to the tang server nodes.
data_volume_count = 1 # Number of volumes to be attached to each tang server node.
}
validation {
condition = lookup(var.tang, "count", 3) == 3
error_message = "The tang.count value must be 3."
}
validation {
condition = lookup(var.tang, "data_volume_count", 1) == 1
error_message = "The tang.data_volume_count must be 1."
}
}
variable "rhel_image_name" {
description = "Name of the RHEL image that you want to use for the bastion node"
default = "rhel-8.6"
}
variable "processor_type" {
description = "The type of processor mode (shared/dedicated)"
default = "shared"
}
variable "system_type" {
description = "The type of system (s922/e980)"
default = "s922"
}
variable "network_name" {
description = "The name of the network to be used for deploy operations"
default = "my_network_tang"
}
variable "rhel_username" {
default = "root"
}
variable "public_key_file" {
description = "Path to public key file"
# if empty, will default to ${path.cwd}/data/id_rsa.pub
default = "data/id_rsa.pub"
}
variable "private_key_file" {
description = "Path to private key file"
# if empty, will default to ${path.cwd}/data/id_rsa
default = "data/id_rsa"
}
variable "private_key" {
description = "content of private ssh key"
# if empty string will read contents of file at var.private_key_file
default = ""
}
variable "public_key" {
description = "Public key"
# if empty string will read contents of file at var.public_key_file
default = ""
}
variable "rhel_subscription_username" {
default = ""
}
variable "rhel_subscription_password" {
default = ""
}
variable "rhel_smt" {
description = "SMT value to set on the node. Eg: on,off,2,4,8"
default = 8
}
################################################################
### Instrumentation
################################################################
variable "ssh_agent" {
description = "Enable or disable SSH Agent. Can correct some connectivity issues. Default: false"
default = false
}
variable "bastion_health_status" {
type = string
description = "Specify if bastion should poll for the Health Status to be OK or WARNING. Default is OK."
default = "OK"
validation {
condition = contains(["OK", "WARNING"], var.bastion_health_status)
error_message = "The bastion_health_status value must be either OK or WARNING."
}
}
variable "dns_forwarders" {
default = "8.8.8.8; 8.8.4.4"
}
# Must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character
# Should not be more than 14 characters
variable "vm_id_prefix" {
default = "infra-node"
}
# Must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character
# Length cannot exceed 14 characters when combined with cluster_id_prefix
variable "vm_id" {
default = ""
}
variable "proxy" {
type = object({})
description = "External Proxy server details in a map"
default = {}
# default = {
# server = "10.10.1.166",
# port = "3128"
# user = "pxuser",
# password = "pxpassword"
# }
}
variable "cluster_id" {
type = string
default = ""
validation {
condition = can(regex("^$|^[a-z0-9]+[a-zA-Z0-9_\\-.]*[a-z0-9]+$", var.cluster_id))
error_message = "The cluster_id value must be a lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
}
validation {
condition = length(var.cluster_id) <= 14
error_message = "The cluster_id value shouldn't be greater than 14 characters."
}
}
variable "domain" {
type = string
default = "ibm.com"
description = "Domain name to use to setup the cluster. A DNS Forward Zone should be a registered in IBM Cloud if use_ibm_cloud_services = true"
validation {
condition = can(regex("^[a-z0-9]+[a-zA-Z0-9_\\-.]*[a-z0-9]+$", var.domain))
error_message = "The domain value must be a lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
}
}
variable "name_prefix" {
type = string
default = ""
validation {
condition = length(var.name_prefix) <= 32
error_message = "Length cannot exceed 32 characters for name_prefix."
}
}
variable "connection_timeout" {
description = "Timeout in minutes for SSH connections"
default = 30
}
variable "private_network_mtu" {
type = number
description = "MTU value for the private network interface on RHEL and RHCOS nodes"
default = 1450
}
variable "rhel_subscription_org" {
type = string
default = ""
}
variable "setup_squid_proxy" {
type = bool
description = "Flag to install and configure squid proxy server on bastion node"
default = false
}
variable "rhel_subscription_activationkey" {
type = string
default = "The subscription key for activating rhel"
}
variable "ansible_repo_name" {
default = "ansible-2.9-for-rhel-8-ppc64le-rpms"
description = "The Ansible repository name"
}
variable "tang_health_status" {
default = "WARNING"
}
variable "cluster_id_prefix" {}
################################################################
### Fips Configuration
################################################################
variable "fips_compliant" {
type = bool
description = "Set to true to enable usage of FIPS for the deployment."
default = false
}