Skip to content

Commit

Permalink
Leverage meta. to enable defaults and overrides.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Aug 16, 2022
1 parent 079d036 commit 7ea342f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
15 changes: 8 additions & 7 deletions manifests/external-postgres.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 1 addition & 4 deletions manifests/scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 7ea342f

Please sign in to comment.