From 2daa4978869b210fb645cc0fbf99c65ee4669d0f Mon Sep 17 00:00:00 2001 From: Martin Buchleitner Date: Thu, 24 Oct 2024 08:33:47 +0200 Subject: [PATCH] update code samples Signed-off-by: Martin Buchleitner --- nomad/app_dynamic.hcl | 2 +- nomad/app_static.hcl | 6 +++--- nomad/app_transit.hcl | 4 +++- nomad/app_transit_connect.hcl | 2 +- nomad/app_transit_connect_traefik.hcl | 2 +- nomad/mysql_connect.hcl | 8 ++++---- nomad/mysql_static.hcl | 9 ++++----- nomad/whoami.hcl | 1 - 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nomad/app_dynamic.hcl b/nomad/app_dynamic.hcl index 584bcda..0728322 100644 --- a/nomad/app_dynamic.hcl +++ b/nomad/app_dynamic.hcl @@ -55,7 +55,7 @@ job "dynamic-app" { {{end}} {{ with secret "dynamic-app/kv/database" }} - Database = {{ .Data.database }} + Database = {{ .Data.data.database }} {{ end }} {{ with secret "dynamic-app/db/creds/app" }} User = {{ .Data.username }} diff --git a/nomad/app_static.hcl b/nomad/app_static.hcl index 993e4cf..dfccba3 100644 --- a/nomad/app_static.hcl +++ b/nomad/app_static.hcl @@ -56,9 +56,9 @@ job "dynamic-app" { {{end}} {{ with secret "dynamic-app/kv/database" }} - Database = {{ .Data.database }} - User = {{ .Data.username }} - Password = {{ .Data.password }} + Database = {{ .Data.data.database }} + User = {{ .Data.data.username }} + Password = {{ .Data.data.password }} {{ end }} [VAULT] Enabled = False diff --git a/nomad/app_transit.hcl b/nomad/app_transit.hcl index 8f95828..1612829 100644 --- a/nomad/app_transit.hcl +++ b/nomad/app_transit.hcl @@ -56,7 +56,9 @@ job "dynamic-app" { Port = {{ .Port }} {{end}} - Database = my_app + {{ with secret "dynamic-app/kv/database" }} + Database = {{ .Data.data.database }} + {{ end }} {{ with secret "dynamic-app/db/creds/app" }} User = {{ .Data.username }} Password = {{ .Data.password }} diff --git a/nomad/app_transit_connect.hcl b/nomad/app_transit_connect.hcl index bff70c0..950d9d0 100644 --- a/nomad/app_transit_connect.hcl +++ b/nomad/app_transit_connect.hcl @@ -65,7 +65,7 @@ job "dynamic-app" { Port = 3306 {{ with secret "dynamic-app/kv/database" }} - Database = {{ .Data.database }} + Database = {{ .Data.data.database }} {{ end }} {{ with secret "dynamic-app/db/creds/app" }} User = {{ .Data.username }} diff --git a/nomad/app_transit_connect_traefik.hcl b/nomad/app_transit_connect_traefik.hcl index 921c1d7..e37c7cc 100644 --- a/nomad/app_transit_connect_traefik.hcl +++ b/nomad/app_transit_connect_traefik.hcl @@ -76,7 +76,7 @@ job "dynamic-app" { Port = 3306 {{ with secret "dynamic-app/kv/database" }} - Database = {{ .Data.database }} + Database = {{ .Data.data.database }} {{ end }} {{ with secret "dynamic-app/db/creds/app" }} User = {{ .Data.username }} diff --git a/nomad/mysql_connect.hcl b/nomad/mysql_connect.hcl index 7013e95..f533a96 100644 --- a/nomad/mysql_connect.hcl +++ b/nomad/mysql_connect.hcl @@ -44,13 +44,13 @@ job "mysql-server" { env = true data = <