# -*- mode: ruby -*-
# vi: set ft=ruby :
#Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
HOSTNAME = File.basename(File.dirname(__FILE__), ".git")

Vagrant.configure(2) do |config|

    config.vm.box = "bento/ubuntu-20.04"

    config.vm.network "forwarded_port", guest: 443, host: 4430
    config.vm.network "forwarded_port", guest: 80, host: 8080

    config.vm.network "private_network", type: "dhcp"

    # 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 "../data", "/vagrant_data"
    config.vm.synced_folder ".", "/vagrant", type: "nfs"

    config.vm.provider "virtualbox" do |vb|
        # Display the VirtualBox GUI when booting the machine
        vb.gui = false

        # Customize the amount of memory on the VM:
        vb.memory = "2048"
    end

    config.vm.hostname = HOSTNAME

    # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
    # such as FTP and Heroku are also available. See the documentation at
    # https://docs.vagrantup.com/v2/push/atlas.html for more information.
    # config.push.define "atlas" do |push|
    #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
    # end

    # Enable provisioning with a shell script. Additional provisioners such as
    # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
    # documentation for more information about their specific syntax and use.
    # config.vm.provision "shell", inline: <<-SHELL
    #   sudo apt-get update
    #   sudo apt-get install -y apache2
    # SHELL

    config.vm.provision "file", source: "vagrant_provision/resources/mw.radiantdelivers.com.crt", destination: "/home/vagrant/mw.radiantdelivers.com.crt"
    config.vm.provision "file", source: "vagrant_provision/resources/mw.radiantdelivers.com_insecure.key", destination: "/home/vagrant/mw.radiantdelivers.com_insecure.key"
    config.vm.provision "shell", path: "vagrant_provision/bootstrap.sh"
end
