This repository was archived by the owner on Mar 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnomad.tf
More file actions
57 lines (52 loc) · 1.66 KB
/
nomad.tf
File metadata and controls
57 lines (52 loc) · 1.66 KB
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
resource "random_password" "authtoken" {
length = 24
special = false
upper = false
keepers = {
revision = 1
}
}
resource "random_password" "sessions_auth" {
length = 32
keepers = {
revision = 1
}
}
resource "random_password" "sessions_encryption" {
length = 32
keepers = {
revision = 1
}
}
resource "random_password" "actioncable_hash" {
length = 32
keepers = {
revision = 1
}
}
resource "nomad_job" "fluitans" {
jobspec = templatefile("${path.module}/fluitans.hcl.tftpl", {
# Job variables
job_name = replace(var.job_name, "-", "_")
datacenter = var.job_datacenter
hostname_constraint = var.job_hostname_constraint
host_network = var.job_host_network
service_name = replace(var.job_name, "_", "-")
public_service = var.job_service_public
publish_service = var.job_service_custom_name != ""
custom_name = var.job_service_custom_name
ztcontroller_public_service = var.job_service_ztcontroller_public
fluitans_version = var.fluitans_version
# Application variables
ztcontroller_authtoken = random_password.authtoken.result
dns_domain_name = var.dns_domain_name
dns_authtoken = var.dns_authtoken
sessions_auth_key = base64encode(random_password.sessions_auth.result)
sessions_encryption_key = base64encode(random_password.sessions_encryption.result)
authn_admin_pw_hash = var.authn_admin_pw_hash
actioncable_hash_key = base64encode(random_password.actioncable_hash.result)
})
hcl2 {
enabled = true
}
}