# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine.
  config.vm.network "forwarded_port", guest: 443, host: 4433
  config.vm.network "forwarded_port", guest: 5432, host: 55432

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  config.vm.synced_folder "./", "/vagrant", type: "rsync", disabled: true

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    #vb.gui = true

    # Customize the amount of memory on the VM:
    vb.memory = "4096"
    vb.cpus = 4
  end
  config.vm.provider "libvirt" do |lv|
    # Customize the amount of memory on the VM:
    lv.memory = "4096"
    lv.cpus = 4
  end

  config.vm.post_up_message = <<-EOM
    Welcome to the Elephant Shed!
    https://elephant-shed.io/

    Default user: admin
    Default pass: admin

    The web interface is at https://localhost:4433/
    PostgreSQL is listening on port 55432:
      psql -h localhost -p 55432 -U admin
  EOM

end
