1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- # -*- mode: ruby -*-
- # vi: set ft=ruby
- Vagrant.configure("2") do ||
- config.vm.box
- config.vm.host_name
- config.vm.provider ||
- v.customize
- end
- config.vm.network
- config.vm.provision
- APP_DB_USER=coin
- APP_DB_NAME=coin
- APP_DB_PASS=coin
- PG_VERSION=9.4
- PG_CONF="/etc/postgresql/$PG_VERSION/main/postgresql.conf"
- PG_HBA="/etc/postgresql/$PG_VERSION/main/pg_hba.conf"
- apt-get
- apt-get
- # Edit
- sed
- # Append
- echo
- cat |
- -- Cleanup, if
- DROP ;
- DROP USER IF EXISTS $APP_DB_USER;
- -- Create the database user:
- CREATE USER $APP_DB_USER WITH PASSWORD '$APP_DB_PASS';
- -- Allow db creation (usefull for unit testing)
- ALTER USER $APP_DB_USER CREATEDB;
- -- Create the database:
- CREATE DATABASE $APP_DB_NAME WITH OWNER=$APP_DB_USER
- LC_COLLATE='en_US.utf8'
- LC_CTYPE='en_US.utf8'
- ENCODING='UTF8'
- TEMPLATE=template0;
- EOF
- systemctl restart postgresql
- SHELL
- end
|