From c7d01705f51944cd20f2d253e4d34d5f1f2518eb Mon Sep 17 00:00:00 2001 From: Daniel Bennett Date: Tue, 5 Dec 2023 08:54:57 -0600 Subject: [PATCH] e2e: push nomad token to servers (#19312) so humans with root shell access can use it to debug not ideal security, but this is a short-lived test cluster --- e2e/terraform/nomad-acls.tf | 34 +++++++++++++++++++++++++++++++++- e2e/terraform/outputs.tf | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/e2e/terraform/nomad-acls.tf b/e2e/terraform/nomad-acls.tf index 1cc1feab8..6d1f16430 100644 --- a/e2e/terraform/nomad-acls.tf +++ b/e2e/terraform/nomad-acls.tf @@ -30,7 +30,39 @@ data "template_file" "bootstrap_nomad_script" { template = "${local.nomad_env} ./scripts/bootstrap-nomad.sh" } -data "local_file" "nomad_token" { +data "local_sensitive_file" "nomad_token" { depends_on = [null_resource.bootstrap_nomad_acls] filename = "${path.root}/keys/nomad_root_token" } + +# push the token out to the servers for humans to use. +# cert/key files are placed by ./provision-nomad module. +# this is here instead of there, because the servers +# must be provisioned before the token can be made, +# so this avoids a dependency cycle. +locals { + root_nomad_env = <