open-nomad/e2e/consultemplate/input/nomad_provider_service.nomad
James Rasell 431c153cd9
client: add Nomad template service functionality to runner. (#12458)
This change modifies the template task runner to utilise the
new consul-template which includes Nomad service lookup template
funcs.

In order to provide security and auth to consul-template, we use
a custom HTTP dialer which is passed to consul-template when
setting up the runner. This method follows Vault implementation.

Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
2022-04-06 19:17:05 +02:00

34 lines
641 B
HCL

job "nomad_provider_service" {
datacenters = ["dc1"]
type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "nomad_provider_service" {
service {
name = "${NOMAD_NAMESPACE}-nomad-provider-service-primary"
provider = "nomad"
tags = ["foo", "bar"]
}
service {
name = "${NOMAD_NAMESPACE}-nomad-provider-service-secondary"
provider = "nomad"
tags = ["baz", "buz"]
}
task "test" {
driver = "raw_exec"
config {
command = "bash"
args = ["-c", "sleep 15000"]
}
}
}
}