12 lines
419 B
Bash
Executable File
12 lines
419 B
Bash
Executable File
#!/bin/sh
|
|
echo "Required .pg.server.public_url is missing"
|
|
|
|
echo "Creating dba role in vault"vault write /database/roles/postgres-admin \
|
|
db_name="postgres" \
|
|
creation_statements="CREATE ROLE \"{{name}}\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; \
|
|
GRANT \"dba\" TO \"{{name}}\"; \
|
|
ALTER ROLE \"{{name}}\" SET role = \"dba\"" \
|
|
default_ttl="12h" \
|
|
max_ttl="720h"
|
|
|