-
Notifications
You must be signed in to change notification settings - Fork 1
/
vault-dev.nomad
97 lines (77 loc) · 1.76 KB
/
vault-dev.nomad
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
job "vault-dev" {
constraint {
attribute = "${attr.unique.hostname}"
value = "sense.station"
operator = "!="
}
datacenters = ["dc1"]
type = "service"
group "server" {
count = 5
network {
port "api" {
static = 8200
}
}
task "init" {
lifecycle {
hook = "prestart"
sidecar = false
}
driver = "raw_exec"
config {
command = "mkdir"
args = ["-vp", "${NOMAD_ALLOC_DIR}/raft"]
}
}
task "server" {
driver = "raw_exec"
constraint {
attribute = "${attr.cpu.arch}"
value = "arm64"
}
resources {
cpu = 1000
memory = 512
}
artifact {
source = "https://releases.hashicorp.com/vault/1.9.2/vault_1.9.2_linux_arm64.zip"
destination = "local/vault"
mode = "file"
}
template {
// source = "vault.hcl.tmpl"
data = <<EOT
listener "tcp" {
address = "{{ env "attr.unique.network.ip-address" }}:8200"
tls_disable = true
}
api_addr = "http://{{ env "attr.unique.network.ip-address" }}:8200"
cluster_addr = "http://{{ env "attr.unique.network.ip-address" }}:8201"
storage "raft" {
path = "{{ env "NOMAD_ALLOC_DIR" }}/raft/"
node_id = "{{ env "attr.unique.hostname" }}"
}
disable_mlock = true
cluster_name = "hah"
telemetry {
disable_hostname = false
prometheus_retention_time = "30s"
}
service_registration "consul" {
address = "127.0.0.1:8500"
service = "vault-dev"
service_tags = "dev"
}
ui = true
log_format = "json"
EOT
destination = "local/vault.d/vault.hcl"
}
config {
command = "local/vault"
args = ["server", "-config=local/vault.d/vault.hcl"]
}
}
}
}