Files
nomad/e2e/exec2/input/secrets.hcl
Seth Hoenig 2054e87158 e2e: add tests for exec2 task driver (#22406)
* e2e: add tests for exec2 task driver

* e2e: use envoy 1.29.4 because consul

* e2e: add a bridge networking http test for exec driver

* e2e: split up http test so curl always starts after the server
2024-05-31 09:22:39 -05:00

68 lines
1.4 KiB
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
# This job writes and reads the secrets directory.
job "secrets" {
type = "batch"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "group" {
reschedule {
attempts = 0
unlimited = false
}
restart {
attempts = 0
mode = "fail"
}
task "nomad-token" {
driver = "exec2"
identity {
file = true
}
config {
command = "cat"
args = ["${NOMAD_SECRETS_DIR}/nomad_token"]
# TODO(shoenig) should not need NOMAD_ values once
# https://github.com/hashicorp/nomad-driver-exec2/issues/29 is
# fixed.
unveil = ["r:${NOMAD_SECRETS_DIR}"]
}
resources {
cpu = 100
memory = 64
}
}
task "password" {
driver = "exec2"
lifecycle {
hook = "prestart"
sidecar = false
}
config {
command = "bash"
args = ["-c", "echo abc123 > ${NOMAD_SECRETS_DIR}/password.txt && cat ${NOMAD_SECRETS_DIR}/password.txt"]
# TODO(shoenig) should not need NOMAD_ values once
# https://github.com/hashicorp/nomad-driver-exec2/issues/29 is
# fixed.
unveil = ["rwc:${NOMAD_SECRETS_DIR}"]
}
resources {
cpu = 100
memory = 64
}
}
}
}