mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 02:45:42 +03:00
52 lines
859 B
HCL
52 lines
859 B
HCL
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
job "template_kv" {
|
|
datacenters = ["dc1"]
|
|
type = "batch"
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
group "group-b" {
|
|
|
|
consul {
|
|
namespace = "banana"
|
|
}
|
|
|
|
task "task-b" {
|
|
driver = "raw_exec"
|
|
|
|
config {
|
|
command = "cat"
|
|
args = ["local/a.txt"]
|
|
}
|
|
|
|
template {
|
|
data = "value: {{ key \"ns-kv-example\" }}"
|
|
destination = "local/a.txt"
|
|
}
|
|
}
|
|
}
|
|
|
|
group "group-z" {
|
|
|
|
# no consul namespace set
|
|
|
|
task "task-z" {
|
|
driver = "raw_exec"
|
|
|
|
config {
|
|
command = "cat"
|
|
args = ["local/a.txt"]
|
|
}
|
|
|
|
template {
|
|
data = "value: {{ key \"ns-kv-example\" }}"
|
|
destination = "local/a.txt"
|
|
}
|
|
}
|
|
}
|
|
} |