diff options
author | tom barrett <spalf0@gmail.com> | 2019-03-22 11:38:32 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-03-22 11:38:32 -0500 |
commit | d6ec0850b896918faf83f0eab325ec8c1f89e2bb (patch) | |
tree | b4d2e676e68b066379e0a7096a98a4ac74e99777 /postgres/bootstrap.sh | |
parent | 95902608506ae8ccd1203cbbf93efbe876384a1f (diff) |
added postgres vagrant instance and test to check connection
Diffstat (limited to 'postgres/bootstrap.sh')
-rw-r--r-- | postgres/bootstrap.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/postgres/bootstrap.sh b/postgres/bootstrap.sh new file mode 100644 index 0000000..03f7eef --- /dev/null +++ b/postgres/bootstrap.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# prepare deps +export DEBIAN_FRONTEND=noninteractive +apt-get update +apt-get upgrade -y +apt-get install -y xauth + +# deps +apt-get install -y postgresql postgresql-client + +# set up db +sudo -u postgres psql -c "CREATE USER space WITH PASSWORD 'space';" +sudo -u postgres psql -c "CREATE DATABASE space_db WITH OWNER space;" + +# copy configs +cp /vagrant/postgres/*conf /etc/postgresql/9.6/main/ + +# systemd +systemctl restart postgresql |