open-nomad/e2e/vaultsecrets/input/secrets.nomad
Tim Gross 4fe1edfd63
Revert "e2e: fix destination of templates in VaultSecrets test (#9146)" (#9163)
This reverts commit 8aed53c177aea024d4f24d1fbb4d6e0881f04eab.
2020-10-23 09:01:25 -04:00

56 lines
985 B
HCL

job "secrets" {
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "group" {
meta {
test_deploy = "DEPLOYNUMBER"
}
task "task" {
driver = "docker"
config {
image = "busybox:1"
command = "/bin/sh"
args = ["-c", "sleep 300"]
}
vault {
policies = ["access-secrets-TESTID"]
}
template {
data = <<EOT
{{ with secret "pki-TESTID/issue/nomad" "common_name=nomad.service.consul" "ip_sans=127.0.0.1" }}
{{- .Data.certificate -}}
{{ end }}
EOT
destination = "${NOMAD_SECRETS_DIR}/certificate.crt"
change_mode = "noop"
}
template {
data = <<EOT
SOME_SECRET={{ with secret "secrets-TESTID/data/myapp" }}{{- .Data.data.key -}}{{end}}
EOT
destination = "${NOMAD_SECRETS_DIR}/access.key"
}
resources {
cpu = 128
memory = 64
}
}
}
}