chore: allow vagrant postgresql remote access

This commit is contained in:
jo 2022-06-21 12:46:50 +02:00 committed by Kyle Robbertze
parent 50877a033b
commit 1a9fa6b559
2 changed files with 18 additions and 0 deletions

5
Vagrantfile vendored
View File

@ -75,6 +75,7 @@ Vagrant.configure('2') do |config|
set -e set -e
cd /vagrant cd /vagrant
LIBRETIME_POSTGRESQL_PASSWORD=libretime \
bash install \ bash install \
--listen-port 8080 \ --listen-port 8080 \
--allow-restart \ --allow-restart \
@ -88,6 +89,10 @@ Vagrant.configure('2') do |config|
SCRIPT SCRIPT
config.vm.provision 'install', type: 'shell', inline: $script config.vm.provision 'install', type: 'shell', inline: $script
config.vm.provision 'post-install',
type: 'shell',
path: 'installer/vagrant/post-install.sh'
end end
# Define all the OS boxes we support # Define all the OS boxes we support

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# append_if_missing <line> <file>
append_if_missing() {
grep -xqF "$1" "$2" || echo "$1" >> "$2"
}
# Setup postgresql remote access
append_if_missing "listen_addresses = '*'" /etc/postgresql/*/main/postgresql.conf
append_if_missing "host all all 0.0.0.0/0 md5" /etc/postgresql/*/main/pg_hba.conf
append_if_missing "host all all ::/0 md5" /etc/postgresql/*/main/pg_hba.conf
systemctl restart postgresql.service