net-ops/global/overlay/etc/puppet/modules/net/templates/cisoassistant/init-db.sh.erb

9 lines
No EOL
311 B
Text

#!/bin/bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER ciso-assistantuser;
ALTER USER ciso-assistantuser WITH PASSWORD '<%= @postgres_password %>';
CREATE DATABASE <%= @db_name %>;
GRANT ALL PRIVILEGES ON DATABASE ciso-assistant TO ciso-assistantuser;
EOSQL