Created
April 20, 2018 12:35
-
-
Save jbarop/32e4d48a90b3da88127d8ed6cbcf325d to your computer and use it in GitHub Desktop.
postgres vm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "bento/fedora-27" | |
| config.vm.network "forwarded_port", guest: 5432, host: 5432, host_ip: "127.0.0.1" | |
| config.vm.provision "shell", inline: <<-SHELL | |
| dnf install https://download.postgresql.org/pub/repos/yum/9.5/fedora/fedora-27-x86_64/pgdg-fedora95-9.5-5.noarch.rpm --assumeyes | |
| dnf install postgresql95-server --assumeyes | |
| /usr/pgsql-9.5/bin/postgresql95-setup initdb | |
| sed -i "s/#listen_addresses.*/listen_addresses '*'/" /var/lib/pgsql/9.5/data/postgresql.conf | |
| echo "host all all 0.0.0.0/0 trust" >> /var/lib/pgsql/9.5/data/pg_hba.conf | |
| echo "host all all ::/0 trust" >> /var/lib/pgsql/9.5/data/pg_hba.conf | |
| systemctl enable postgresql-9.5 | |
| systemctl start postgresql-9.5 | |
| SHELL | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment