Last active
February 14, 2017 16:31
-
-
Save sebastianwebber/453cf4063801f9a6946c55976e468a0c to your computer and use it in GitHub Desktop.
Ubuntu 16.04 vagrantfile with postgresql 9.5
This file contains 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 = "ubuntu/xenial64" | |
$script = <<SCRIPT | |
sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -c | awk '{print $2}')-pgdg main" > /etc/apt/sources.list.d/pgdg.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7FCC7D46ACCC4CF8 | |
sudo apt-get update | |
sudo apt install -y postgresql-9.5 | |
SCRIPT | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = "2048" | |
end | |
config.vm.provision :shell, inline: $script | |
config.vm.define "master" do |master| | |
master.vm.hostname = "masterdb" | |
master.vm.network "private_network", ip: "192.168.100.100" | |
end | |
config.vm.define "slave" do |slave| | |
slave.vm.hostname = "slavedb" | |
slave.vm.network "private_network", ip: "192.168.100.200" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment