generated from IBM/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
variables.tf
565 lines (474 loc) · 16.2 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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
################################################################
# Copyright 2023 - IBM Corporation. All rights reserved
# SPDX-License-Identifier: Apache-2.0
################################################################
# *Design Note*
# Global variables are prefixed with ibmcloud_
# PowerVS variables are prefixed with powervs_
# VPC variables are prefixed with vpc_
variable "ibmcloud_api_key" {
type = string
description = "IBM Cloud API key associated with user's identity"
default = "<key>"
validation {
condition = var.ibmcloud_api_key != "<key>"
error_message = "The api key is empty, check that the -var-file= is set properly"
}
}
################################################################
# Configure the IBM PowerVS provider
################################################################
variable "powervs_service_instance_id" {
type = string
description = "The PowerVS service instance ID of your account"
default = ""
}
variable "powervs_region" {
type = string
description = "The IBM Cloud region where you want to create the workers"
default = ""
}
variable "powervs_zone" {
type = string
description = "The zone of an IBM Cloud region where you want to create Power System workers"
default = ""
}
################################################################
# Configure the IBM VPC provider
################################################################
variable "vpc_name" {
type = string
description = "The name of an IBM Cloud VPC where OCP cluster is running"
default = ""
}
variable "vpc_region" {
type = string
description = "The region of an IBM Cloud VPC where OCP cluster is running"
default = ""
}
variable "vpc_zone" {
type = string
description = "The zone of an IBM Cloud VPC where OCP cluster is running"
default = ""
}
################################################################
# The OpenShift Cluster details
################################################################
variable "openshift_api_url" {
type = string
description = "The API URL of the OpenShift Cluster"
default = "https://api.example.ocp-multiarch.xyz:6443"
}
variable "openshift_user" {
type = string
description = "The user of the OpenShift Cluster"
default = ""
}
variable "openshift_pass" {
type = string
description = "The pass of the OpenShift Cluster"
default = ""
}
variable "kubeconfig_file" {
type = string
description = "Path to kubeconfig file"
default = "data/kubeconfig"
# if empty, will default to ${path.cwd}/data/kubeconfig
}
################################################################
# The PowerVS Instance configuration settings
################################################################
variable "processor_type" {
type = string
description = "The type of processor mode (shared/dedicated)"
default = "shared"
}
# Reference https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-about-virtual-server
# The default is s922.
variable "system_type" {
type = string
description = "The type of system (s922/e980/s1022/s1080)"
default = "s922"
}
################################################################
# Configure the PowerVS instance bastion details
################################################################
variable "bastion" {
type = object({ count = number, memory = string, processors = string })
default = {
count = 1
memory = "16"
processors = "1"
}
validation {
condition = lookup(var.bastion, "count", 1) >= 1 && lookup(var.bastion, "count", 1) <= 2
error_message = "The bastion.count value must be either 1 or 2."
}
}
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 = "WARNING"
validation {
condition = contains(["OK", "WARNING"], var.bastion_health_status)
error_message = "The bastion_health_status value must be either OK or WARNING."
}
}
# Centos default is CentOS-Stream-9
variable "rhel_image_name" {
type = string
description = "Name of the RHEL or Centos image that you want to use for the bastion node"
default = "CentOS-Stream-9"
}
variable "rhel_username" {
type = string
default = "root"
}
variable "rhel_subscription_username" {
type = string
default = ""
}
variable "rhel_subscription_password" {
type = string
default = ""
}
variable "rhel_subscription_org" {
type = string
default = ""
}
variable "rhel_subscription_activationkey" {
type = string
default = ""
}
# SMT level is 8 which is the maximum.
variable "rhel_smt" {
type = number
description = "SMT value to set on the bastion node. Eg: on,off,2,4,8"
default = 8
}
################################################################
# Configure the PowerVS workers to be added to the compute plane
################################################################
variable "worker" {
default = {
count = 1
memory = "16"
processors = "1"
}
type = object({ count = number, memory = string, processors = string })
description = "The worker configuration details. You may have 0 or more workers"
validation {
condition = lookup(var.worker, "count", 1) >= 0
error_message = "The worker.count value must be greater than 0."
}
nullable = false
}
################################################################
# RHCOS PowerVS Details
################################################################
variable "rhcos_image_name" {
type = string
description = "Name of the rhcos image that you want to use for the workers"
default = "rhcos-4.14"
}
variable "rhcos_import_image" {
type = bool
description = "Set to true to upload RHCOS image to PowerVS from Cloud Object Storage."
default = false
}
variable "rhcos_import_image_filename" {
type = string
description = "Name of the RHCOS image object file. This file is expected to be in .ova.gz format"
default = "rhcos-414-92-202307050443-0-ppc64le-powervs.ova.gz"
}
variable "rhcos_import_image_storage_type" {
type = string
description = "Storage type in PowerVS where the RHCOS image needs to be uploaded"
default = "tier1"
}
variable "rhcos_import_image_region_override" {
type = string
description = "Overrides the region used to import"
default = ""
}
### RHCOS Instance Details
variable "rhcos_pre_kernel_options" {
type = list(string)
description = "List of kernel arguments for the cluster nodes that for pre-installation"
default = []
}
variable "rhcos_kernel_options" {
type = list(string)
description = "List of kernel arguments for the cluster nodes"
default = []
}
################################################################
# PowerVS Network - Networking
################################################################
variable "powervs_machine_cidr" {
type = string
description = "PowerVS DHCP Network cidr eg. 192.168.200.0/24"
default = "192.168.200.0/24"
}
################################################################
### OpenShift variables
################################################################
variable "openshift_client_tarball" {
type = string
default = "https://mirror.openshift.com/pub/openshift-v4/multi/clients/ocp/stable/ppc64le/openshift-client-linux.tar.gz"
}
variable "release_image_override" {
type = string
default = ""
}
# Must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character
variable "cluster_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_ibmcloud_services = true"
validation {
condition = can(regex("^[a-z0-9]+[a-zA-Z0-9_\\-.]*[a-z0-9]+$", var.cluster_domain))
error_message = "The cluster_domain value must be a lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
}
}
# 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 "cluster_id_prefix" {
type = string
default = "test-ocp"
validation {
condition = can(regex("^$|^[a-z0-9]+[a-zA-Z0-9_\\-.]*[a-z0-9]+$", var.cluster_id_prefix))
error_message = "The cluster_id_prefix value must be a lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
}
validation {
condition = length(var.cluster_id_prefix) <= 14
error_message = "The cluster_id_prefix value shouldn't be greater than 14 characters."
}
}
# 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 "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 "use_zone_info_for_names" {
type = bool
default = true
description = "Add zone info to instance name or not"
}
variable "cluster_network_mtu" {
type = number
description = "MTU value for the OCP cluster network"
default = 1350
}
################################################################
# Additional Settings
################################################################
variable "ssh_agent" {
type = bool
description = "Enable or disable SSH Agent. Can correct some connectivity issues. Default: false"
default = false
}
variable "connection_timeout" {
description = "Timeout in minutes for SSH connections"
default = 30
}
variable "helpernode_repo" {
type = string
description = "Set the repo URL for using ocp4-helpernode"
default = "https://github.com/redhat-cop/ocp4-helpernode"
# Repo for running ocp4 installations steps.
}
variable "helpernode_tag" {
type = string
description = "Set the branch/tag name or commit# for using ocp4-helpernode repo"
default = "adb1102f64b2f25a8a1b44a96c414f293d72d3fc"
# Checkout level for var.helpernode_repo which is used for setting up services required on bastion node
}
variable "install_playbook_repo" {
type = string
description = "Set the repo URL for using ocp4-playbooks"
default = "https://github.com/ocp-power-automation/ocp4-playbooks"
# Repo for running ocp4 installations steps.
}
variable "install_playbook_tag" {
type = string
description = "Set the branch/tag name or commit# for using ocp4-playbooks repo"
default = "main"
# Checkout level for var.install_playbook_repo which is used for running ocp4 installations steps
}
variable "ansible_extra_options" {
type = string
description = "Extra options string to append to ansible-playbook commands"
default = "-v"
}
variable "ansible_repo_name" {
default = "ansible-2.9-for-rhel-8-ppc64le-rpms"
}
variable "private_network_mtu" {
type = number
description = "MTU value for the private network interface on RHEL and RHCOS nodes"
default = 1500
}
variable "installer_log_level" {
type = string
description = "Set the log level required for openshift-install commands"
default = "info"
}
variable "public_key_name" {
type = string
default = "<none>"
}
variable "powervs_dns_forwarders" {
type = string
default = "8.8.8.8;8.8.4.4"
}
variable "node_labels" {
type = map(string)
description = "Map of node labels for the cluster nodes"
default = {}
}
variable "enable_snat" {
type = bool
description = "Enables SNAT on the DHCP service"
default = true
}
variable "nfs_server" {
type = string
description = "IP address of existing NFS Server"
default = "none"
}
variable "nfs_path" {
type = string
description = "Path on NFS Server where storage is mounted"
default = "/export"
}
variable "remove_nfs_deployment" {
type = bool
description = "Removes the NFS deployment running in nfs-provisioner Namespace"
default = false
}
variable "skip_vpc_key" {
type = bool
description = "Flag to skip creation of key in VPC"
default = false
}
##########################################
variable "public_key_file" {
type = string
description = "Path to public key file"
default = "data/id_rsa.pub"
# if empty, will default to ${path.cwd}/data/id_rsa.pub
}
variable "private_key_file" {
type = string
description = "Path to private key file"
default = "data/id_rsa"
# if empty, will default to ${path.cwd}/data/id_rsa
}
variable "private_key" {
type = string
description = "content of private ssh key"
default = ""
# if empty, will read contents of file at var.private_key_file
}
variable "public_key" {
type = string
description = "Public key"
default = ""
# if empty, will read contents of file at var.public_key_file
}
###
variable "name_prefix" {
type = string
default = ""
validation {
condition = length(var.name_prefix) <= 32
error_message = "Length cannot exceed 32 characters for name_prefix."
}
}
variable "node_prefix" {
type = string
default = ""
validation {
condition = length(var.node_prefix) <= 32
error_message = "Length cannot exceed 32 characters for node_prefix."
}
}
###
locals {
private_key_file = var.private_key_file == "" ? "${path.cwd}/data/id_rsa" : var.private_key_file
public_key_file = var.public_key_file == "" ? "${path.cwd}/data/id_rsa.pub" : var.public_key_file
private_key = var.private_key == "" ? file(coalesce(local.private_key_file, "/dev/null")) : var.private_key
public_key = var.public_key == "" ? file(coalesce(local.public_key_file, "/dev/null")) : var.public_key
}
################################################################
# Overrides the Region Check
################################################################
variable "override_region_check" {
type = bool
description = "Set to true if you want to skip region checks."
default = false
}
variable "vpc_supp_public_ip" {
type = bool
description = "Set to true to create a public ip for the PowerVS (vpc) support machine"
default = false
}
################################################################
# Supports the CICD features
################################################################
variable "cicd" {
type = bool
description = "Flips on additional checks used by cicd"
default = false
}
variable "mac_tags" {
type = list(string)
description = "Tags to mac resources"
default = []
}
variable "keep_dns" {
type = bool
description = "Moves the dns pods to the Intel nodes"
default = false
}
variable "cicd_disable_defrag" {
type = bool
description = "Creates a config map 'etcd-disable-defrag' to disable the etcd defragmentation"
default = false
# User needs to manually remove the config map to restore the settings
}
variable "cicd_etcd_secondary_disk" {
type = bool
description = "moves etcd disk to secondary devices"
default = false
# not for customer, cicd-only
}
################################################################
# Overrides the dhcp network, transit gateway creation from a
# PowerVS perspective.
################################################################
variable "setup_transit_gateway" {
type = bool
description = "Flag to create the new transit gateway by automation"
default = false
}
variable "transit_gateway_name" {
type = string
description = "uses an existing transit gateway"
default = ""
}
variable "override_network_name" {
type = string
description = "overrides network creation for a specific dhcp network"
default = ""
}