Skip to content

Instantly share code, notes, and snippets.

@schmichael
Created February 23, 2023 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schmichael/ac5fd122f7b358a879fcef8c74f6f40b to your computer and use it in GitHub Desktop.
Save schmichael/ac5fd122f7b358a879fcef8c74f6f40b to your computer and use it in GitHub Desktop.
job "example" {
group "cache" {
network {
port "db" {
to = 6379
}
}
task "redis" {
driver = "docker"
config {
image = "redis:7"
ports = ["db"]
auth_soft_fail = true
}
identity {
env = true
file = true
}
template {
change_mode = "signal"
destination = "local/template.txt"
data = <<EOF
consul: {{ key "foo" }}
nomad: {{ with nomadVar "nomad/jobs/example/cache/redis" }}{{ .foo }}{{ end }}
EOF
}
resources {
cpu = 500
memory = 256
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment