cdn-ops/global/overlay/etc/puppet/modules/cdn/files/db/init-cdn-db.sh

11 lines
253 B
Bash

#!/bin/bash
set -e
. /conf/init-cdn-db.conf
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER cdn WITH PASSWORD '$cdn_password';
CREATE DATABASE cdn;
GRANT ALL PRIVILEGES ON DATABASE cdn TO cdn;
EOSQL