From 7ea342f050182450689e29ffde85788405bc7108 Mon Sep 17 00:00:00 2001 From: "Wayne E. Seguin" Date: Tue, 16 Aug 2022 14:43:15 -0400 Subject: [PATCH] Leverage meta. to enable defaults and overrides. --- manifests/external-postgres.yml | 15 ++++++++------- manifests/scheduler.yml | 5 +---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/manifests/external-postgres.yml b/manifests/external-postgres.yml index d67bf11..8ec34fe 100644 --- a/manifests/external-postgres.yml +++ b/manifests/external-postgres.yml @@ -1,12 +1,13 @@ --- -params: +meta: pg: - host: (( param "Please provide the hostname / IP of your external PostgreSQL database instance." )) - port: 5432 - scheme: postgres - user: (( vault.path "external_db:username")) - pass: (( vault.path "external_db:password")) - # sslmode: enable + scheme: (( params.pg.scheme || "postgres" )) + username: (( params.pg.username || vault.path "external_db:username" || "postgres" )) + password: (( params.pg.password || vault.path "external_db:password" )) + hostname: (( params.pg.hostname || vault.path "external_db:hostname" )) + port: (( params.pg.port || 5432 )) + sslmode: (( params.pg.sslmode || "disable" )) + database: (( params.pg.database || "scheduler" )) instance_groups: - name: scheduler diff --git a/manifests/scheduler.yml b/manifests/scheduler.yml index 292c8f6..c8f560d 100644 --- a/manifests/scheduler.yml +++ b/manifests/scheduler.yml @@ -31,9 +31,6 @@ params: client_secret: (( vault meta.cf.exodus ":app_scheduler_secret" )) scheduler: domain: (( concat "scheduler." meta.cf.system_domain )) - pg: - sslmode: "disable" - database: "scheduler" instance_groups: - name: scheduler @@ -60,7 +57,7 @@ instance_groups: cf: api: (( concat "https://api." params.cf.system_domain )) postgres: - uri: (( concat "postgres://" params.pg.user ":" params.pg.pass "@" params.pg.host ":" params.pg.port "/" params.pg.database "?sslmode=" params.pg.sslmode )) + uri: (( concat "postgres://" meta.pg.user ":" meta.pg.pass "@" meta.pg.hostname ":" meta.pg.port "/" meta.pg.database "?sslmode=" meta.pg.sslmode )) - name: postgres properties: