2021-04-14 23:02:42 +00:00
|
|
|
job "template_kv" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "batch"
|
|
|
|
|
|
|
|
constraint {
|
|
|
|
attribute = "${attr.kernel.name}"
|
|
|
|
value = "linux"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "group-b" {
|
|
|
|
|
|
|
|
consul {
|
|
|
|
namespace = "banana"
|
|
|
|
}
|
|
|
|
|
|
|
|
task "task-b" {
|
2021-04-19 17:29:36 +00:00
|
|
|
driver = "raw_exec"
|
2021-04-14 23:02:42 +00:00
|
|
|
|
|
|
|
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" {
|
2021-04-19 17:29:36 +00:00
|
|
|
driver = "raw_exec"
|
2021-04-14 23:02:42 +00:00
|
|
|
|
|
|
|
config {
|
|
|
|
command = "cat"
|
|
|
|
args = ["local/a.txt"]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "value: {{ key \"ns-kv-example\" }}"
|
|
|
|
destination = "local/a.txt"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|