-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
162 lines (130 loc) · 5.09 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
# Username and password for the initial admin user
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 "enterprise-edition" {
description = "Whether to provision enterprise edition (EE) or community edition (CE). EE requires image files to be provided"
default = false
}
variable "parallell-image-pull" {
description = "Download and pull docker images on all nodes in parallell before starting ICP installation."
default = false
}
variable "image_file" {
description = "Filename of image. Only required for enterprise edition"
default = "/dev/null"
}
variable "image_location" {
description = "Alternative to image_file, if image is accessible to the new vm over nfs or http"
default = "false"
}
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 = ""
}
variable "icp-version" {
description = "Version of ICP to provision. For example 1.2.0, 1.2.0-ee, 2.1.0-beta1"
default = "2.1.0.2"
}
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 "ssh_key" {
description = "Private key corresponding to the public key that the cloud servers are provisioned with. DEPRECATED. Use ssh_key_file or ssh_key_base64"
default = "~/.ssh/id_rsa"
}
variable "ssh_key_base64" {
description = "base64 encoded content of private ssh key"
default = ""
}
variable "ssh_key_file" {
description = "Location of private ssh key. i.e. ~/.ssh/id_rsa"
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 = ""
}
variable "cluster_size" {
description = "Define total clustersize. Workaround for terraform issue #10857."
}
/*
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 "hooks" {
description = "Hooks into different stages in the cluster setup process"
type = "map"
default = {}
}
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 = ""
}
variable "install-verbosity" {
description = "Verbosity of ansible installer output. -v to -vvvv where the maximum level includes connectivity information"
default = ""
}
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 = "${var.ssh_key_base64 == "" ? file(coalesce(var.ssh_key_file, "/dev/null")) : base64decode(var.ssh_key_base64)}"
boot-node = "${element(compact(concat(list(var.boot-node),var.icp-master)), 0)}"
}