commit 6fe7e0ce0c4d315ce8640ccd4adb55c1446dfdcf
parent 82da18c8e95dcc5e0b9966e58272d93a7a2e8f7b
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Thu, 28 Nov 2024 11:56:51 +0100
fix: vault_addr on client nodes
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/hashi-pi.pkr.hcl b/hashi-pi.pkr.hcl
@@ -98,6 +98,11 @@ variable "username" {
default = "in0rdr"
}
+variable "vault_addr" {
+ type = string
+ default = "https://vault.in0rdr.ch"
+}
+
variable "vault_tls_ca_cert" {
type = string
default = "./tls/vault/ca/vault_ca.pem"
@@ -215,7 +220,8 @@ build {
"NOMAD_CLIENT=${var.nomad_client}",
"NOMAD_PODMAN_DRIVER_VERSION=${var.nomad_podman_driver_version}",
"NOMAD_JENKINS_UID=${var.nomad_jenkins_uid}",
- "NOMAD_JENKINS_GID=${var.nomad_jenkins_gid}"
+ "NOMAD_JENKINS_GID=${var.nomad_jenkins_gid}",
+ "VAULT_ADDR=${var.vault_addr}"
]
}
diff --git a/nomad.sh b/nomad.sh
@@ -42,7 +42,7 @@ vault {
# Nomad servers require a Vault Token set in /etc/nomad.d/nomad.env
# Nomad clients use the use the allocation's Vault token
enabled = true
- address = "https://127.0.0.1:8200"
+ address = "$VAULT_ADDR"
tls_skip_verify = true
$(if [[ "$NOMAD_SERVER" = true ]]; then
# Only servers create further Tokens for clients from the Token role