-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquake.tf
54 lines (47 loc) · 1.45 KB
/
quake.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
resource "nomad_job" "quake" {
jobspec = templatefile("${path.module}/quake/quake.hcl", {
datacenter = var.datacenter
static_port = var.static_port
cpu = var.cpu
memory = var.memory
service_meta = local.service_meta
ktx = templatefile("${path.module}/quake/ktx.cfg.tpl", local.ktx)
mvdsv = templatefile("${path.module}/quake/mvdsv.cfg.tpl", local.mvdsv)
pwd = templatefile("${path.module}/quake/pwd.cfg.tpl", local.passwords)
vip_ip = templatefile("${path.module}/quake/vip_ip.cfg.tpl", local.vip)
server = templatefile("${path.module}/quake/server.cfg.tpl", {})
entrypoint = templatefile("${path.module}/quake/entrypoint.sh", {})
})
hcl2 {
enabled = true
}
lifecycle {
ignore_changes = [allocation_ids]
}
}
locals {
ktx = {
name = var.name
report_url = var.report_url
report_key = var.report_key
defmode = var.modes.defmode
mode = var.modes.current
map = var.modes.map
matchless = var.modes.matchless ? 1 : 0
}
mvdsv = {
name = var.name
admin_contact = var.admin_contact
}
passwords = {
rcon = coalesce(var.rcon_password, random_password.rcon.result)
qtv = coalesce(var.qtv_password, random_password.qtv.result)
}
vip = {
admin_client_ips = var.admin_client_ips
}
service_meta = merge({
protocol = "udp"
port = 27500
}, var.service_meta)
}