-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathvariables.tf
209 lines (168 loc) · 6.12 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
# Username and password for the initial admin user
### ICP node topology
variable "icp-master" {
type = "list"
description = "IP address of ICP Masters. First master will also be boot master. CE edition only supports single master "
default = []
}
variable "icp-worker" {
type = "list"
description = "IP addresses of ICP Worker nodes."
default = []
}
variable "icp-proxy" {
type = "list"
description = "IP addresses of ICP Proxy nodes."
default = []
}
variable "icp-management" {
type = "list"
description = "IP addresses of ICP Management Nodes, if management is to be separated from master nodes. Optional"
default = []
}
variable "cluster_size" {
description = "Define total clustersize. Workaround for terraform issue #10857."
}
### ICP inception settings
variable "image_location" {
description = "NFS or HTTP location where image tarball can be accessed"
default = ""
}
variable "image_locations" {
type = "list"
description = "List of HTTP locations where image tarballs can be accessed. Typically used in multi-arch deployment"
default = []
}
variable "image_location_user" {
description = "Username if authentication required for image_location"
default = ""
}
variable "image_location_pass" {
description = "Pass if authentication required for image_location"
default = ""
}
variable "cluster-directory" {
description = "Location to use for the cluster directory"
default = "/opt/ibm/cluster"
}
variable "icp-inception" {
description = "Version of ICP to provision. For example 3.1.2 or myuser:mypass@registry/ibmcom/icp-inception:3.1.2-ee"
default = ""
}
variable "install-command" {
description = "Installer command to run"
default = "install"
}
variable "install-verbosity" {
description = "Verbosity of ansible installer output. -v to -vvvv where the maximum level includes connectivity information"
default = ""
}
### SSH CONNECTION DETAILS
variable "ssh_user" {
description = "Username to ssh into the ICP cluster. This is typically the default user with for the relevant cloud vendor"
default = "root"
}
variable "cluster_dir_owner" {
description = "Username to own the ICP cluster directory after installation completes; defaults to ssh_user"
default = ""
}
variable "ssh_key_base64" {
description = "base64 encoded content of private ssh key"
default = ""
}
variable "ssh_agent" {
description = "Enable or disable SSH Agent. Can correct some connectivity issues. Default: true (enabled)"
default = true
}
variable "bastion_host" {
description = "Specify hostname or IP to connect to nodes through a SSH bastion host. Assumes same SSH key and username as cluster nodes"
default = ""
}
variable "generate_key" {
description = "Whether to generate a new ssh key for use by ICP Boot Master to communicate with other nodes"
default = true
}
variable "icp_pub_key" {
description = "Public ssh key for ICP Boot master to connect to ICP Cluster. Only use when generate_key = false"
default = ""
}
variable "icp_priv_key" {
description = "Private ssh key for ICP Boot master to connect to ICP Cluster. Only use when generate_key = false"
default = ""
}
### ICP CONFIGURATION
/*
Configuration file is generated from items in the following order
1. config.yaml shipped with ICP (if config_strategy = merge, else blank)
2. config.yaml specified in icp_config_file
3. key: value items specified in icp_configuration
*/
variable "icp_config_file" {
description = "Yaml configuration file for ICP installation"
default = "/dev/null"
}
variable "icp_configuration" {
description = "Configuration items for ICP installation."
type = "map"
default = {}
}
variable "config_strategy" {
description = "Strategy for original config.yaml shipped with ICP. Default is merge, everything else means override"
default = "merge"
}
variable "icp-host-groups" {
description = "Map of host groups and IPs in the cluster. Needs at least master, proxy and worker"
type = "map"
default = {}
}
variable "boot-node" {
description = "Node where ICP installer will be run from. Often first master node, but can be different"
default = ""
}
### HOOKS
variable "hooks" {
description = "Hooks into different stages in the cluster setup process; each must be a list"
type = "map"
default = {
cluster-preconfig = ["echo -n"]
cluster-postconfig = ["echo -n"]
boot-preconfig = ["echo -n"]
preinstall = ["echo -n"]
postinstall = ["echo -n"]
}
}
variable "local-hooks" {
description = "Local hooks into different stages in the cluster setup process; each must be a single command"
type = "map"
default = {
local-preinstall = "echo -n"
local-postinstall = "echo -n"
}
}
variable "on_hook_failure" {
description = "Behavior when hooks fail. Anything other than `fail` will `continue`"
default = "fail"
}
### DOCKER PARAMETERS
variable "docker_image_name" {
description = "Name of docker image to install; only supported for Ubuntu"
default = "docker-ce"
}
variable "docker_version" {
description = "Version of docker image to install; only supported for Ubuntu"
default = "latest"
}
variable "docker_package_location" {
description = "http or nfs location of docker installer which ships with ICP. Option for RHEL which does not support docker-ce"
default = ""
}
### LOCAL VARIABLES
locals {
spec-icp-ips = "${distinct(compact(concat(list(var.boot-node), var.icp-master, var.icp-proxy, var.icp-management, var.icp-worker)))}"
host-group-ips = "${distinct(compact(concat(list(var.boot-node), keys(transpose(var.icp-host-groups)))))}"
icp-ips = "${distinct(concat(local.spec-icp-ips, local.host-group-ips))}"
cluster_size = "${length(concat(var.icp-master, var.icp-proxy, var.icp-worker, var.icp-management))}"
ssh_key = "${base64decode(var.ssh_key_base64)}"
boot-node = "${element(compact(concat(list(var.boot-node),var.icp-master)), 0)}"
cluster_dir_owner = "${var.cluster_dir_owner == "" ? var.ssh_user : var.cluster_dir_owner}"
}