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

9 lines
311 B
Text
Raw Normal View History

2025-05-10 20:47:20 +02:00
#!/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