-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.hcl
338 lines (278 loc) · 7.69 KB
/
variables.hcl
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
#######################################
## Application-specific Configuration #
#######################################
variable "app_rwa_admin" {
type = bool
description = "Toggle to set Initial User as Admin."
default = true
}
variable "app_rwa_env" {
type = bool
description = "Toggle to allow configuration through Environment Variables."
default = true
}
variable "app_rwa_game" {
type = string
description = "Initial Game-Type."
default = "minecraft"
}
variable "app_rwa_password" {
type = string
description = "Initial User Password."
default = "AW96B6"
}
variable "app_rwa_rcon_host" {
type = string
description = "RCON Target Server Host."
default = "172.17.0.2"
}
variable "app_rwa_rcon_port" {
type = number
description = "RCON Target Server Port."
default = 25575
}
variable "app_rwa_rcon_password" {
type = string
description = "RCON Target Server Password."
default = "AW96B6"
}
variable "app_rwa_read_only_widget_options" {
type = bool
description = "Toggle to prevent Initial User from changing Widget Options."
default = false
}
variable "app_rwa_restrict_commands" {
type = string
description = "Restricted Commands for Initial User."
default = "ban,deop,stop"
}
variable "app_rwa_restrict_widgets" {
type = string
description = "Hidden Widgets for Initial User."
default = ""
}
variable "app_rwa_server_name" {
type = string
description = "Name of Target Server."
default = "minecraft"
}
variable "app_rwa_username" {
type = string
description = "Initial User Username."
default = "admin"
}
variable "app_rwa_web_rcon" {
type = bool
description = "Toggle to enable Web RCON on Target Server."
default = false
}
###############################
## Pack-specific Configuration #
###############################
variable "nomad_pack_verbose_output" {
type = bool
description = "Toggle to enable verbose output."
default = true
}
#####################################
## Nomad Job-specific Configuration #
#####################################
# see https://developer.hashicorp.com/nomad/docs/concepts/architecture#datacenters
variable "nomad_job_datacenters" {
type = list(string)
description = "Eligible Datacenters for the Job."
default = [
"*"
]
}
variable "nomad_job_name" {
type = string
description = "Name for the Job."
# value will be truncated to 63 characters when necessary
default = "rcon_web"
}
# see https://developer.hashicorp.com/nomad/docs/job-specification/job#namespace
variable "nomad_job_namespace" {
type = string
description = "Namespace for the Job."
default = "default"
}
# see https://developer.hashicorp.com/nomad/docs/job-specification/job#priority
variable "nomad_job_priority" {
type = number
description = "Priority for the Job."
default = 50
}
# see https://developer.hashicorp.com/nomad/docs/concepts/architecture#regions
variable "nomad_job_region" {
type = string
description = "Region for the Job."
default = "global"
}
variable "nomad_group_count" {
type = number
description = "Count of Deployments for the Group."
default = 1
}
variable "nomad_task_driver" {
type = string
description = "Driver to use for the Task."
default = "docker"
}
# see https://developer.hashicorp.com/nomad/docs/job-specification/ephemeral_disk
variable "nomad_group_ephemeral_disk" {
type = object({
migrate = bool
size = number
sticky = bool
})
description = "Ephemeral Disk Configuration for the Group."
default = {
# make best-effort attempt to migrate data to a different node if no placement is possible on the original node.
migrate = true
# size of the ephemeral disk in MB
size = 128
# make best-effort attempt to place an updated allocation on the same node.
sticky = false
}
}
variable "nomad_group_name" {
type = string
description = "Name for the Group."
default = "rcon"
}
variable "nomad_task_image" {
type = object({
registry = string
namespace = string
image = string
tag = string
digest = string
})
description = "Content Address to use for the Container Image for the Task."
# see https://hub.docker.com/r/itzg/rcon/tags
default = {
# Container Registry URL where the Image is hosted
registry = "index.docker.io"
# Namespace of the Image
namespace = "itzg"
# Slug of the Image
image = "rcon"
# Tag of the Image
tag = "latest"
# Digest of the Tag of the Image
digest = "sha256:a9fc0b4116a7034c4849a4160d139a589bbf9211df64b48cc404e74c3e7bb730"
}
}
# see https://developer.hashicorp.com/nomad/docs/job-specification/network#network-modes
variable "nomad_group_network_mode" {
type = string
description = "Network Mode for the Group."
default = "host"
}
variable "nomad_group_ports" {
type = map(object({
name = string
path = string
port = number
type = string
host_network = string
check_interval = string
check_timeout = string
}))
description = "Port and Healthcheck Configuration for the Group."
default = {
# port for web UI
main = {
name = "main"
path = "/"
port = 4326
type = "http"
host_network = null
check_interval = "30s"
check_timeout = "15s"
},
# port for WebSocket Interface
websocket = {
name = "websocket"
path = null
port = 4327
type = "tcp"
host_network = null
check_interval = "30s"
check_timeout = "15s"
},
}
}
variable "nomad_group_restart_logic" {
type = object({
attempts = number
interval = string
delay = string
mode = string
})
description = "Restart Logic for the Group."
default = {
attempts = 3
interval = "120s"
delay = "30s"
mode = "fail"
}
}
variable "nomad_group_service_name_prefix" {
type = string
description = "Name of the Service for the Group."
default = "rcon_web"
}
variable "nomad_group_service_provider" {
type = string
description = "Provider of the Service for the Group."
default = "nomad"
}
variable "nomad_group_tags" {
type = list(string)
description = "List of Tags for the Group."
default = [
"rcon",
]
}
variable "nomad_group_volumes" {
type = map(object({
name = string
type = string
destination = string
read_only = bool
}))
description = "Volumes for the Group."
default = {}
}
variable "nomad_task_name" {
type = string
description = "Name for the Task."
default = "rcon_web"
}
# see https://developer.hashicorp.com/nomad/docs/job-specification/resources
variable "nomad_task_resources" {
type = object({
cpu = number
cores = number
memory = number
memory_max = number
})
description = "Resource Limits for the Task."
default = {
# Tasks can ask for `cpu` or `cores`, not both.
# value in MHz
cpu = 500
# Tasks can ask for `cpu` or `cores`, not both.
# see https://developer.hashicorp.com/nomad/docs/job-specification/resources#cores
# and https://developer.hashicorp.com/nomad/docs/drivers/docker#cpu
cores = null
# value in MB
memory = 512
# value in MB
# see https://developer.hashicorp.com/nomad/docs/job-specification/resources#memory-oversubscription
# and https://developer.hashicorp.com/nomad/docs/drivers/docker#memory
memory_max = 1024
}
}