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

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.hostmanager.enabled = true
  config.hostmanager.manage_host = false
  config.hostmanager.ignore_private_ip = false
  config.hostmanager.include_offline = true
  config.vm.box = "ubuntu/trusty64"

  config.vm.define "controller1" do |controller1|
    controller1.vm.network :private_network, ip: "192.168.11.4" # Tunnel Network
    controller1.vm.network :private_network, ip: "192.168.22.4" # External Network
    controller1.vm.network :private_network, ip: "172.16.33.4"  # Management Network (USE)
    controller1.vm.network :private_network, ip: "172.16.44.4"  # Storage Network
    controller1.vm.hostname = "controller1"
    controller1.vm.provider "virtualbox" do |vb|
      vb.memory = "2048"
    end
  end
  config.vm.define "storage1" do |storage1|
    storage1.vm.network :private_network, ip: "192.168.11.5" # Tunnel Network
    storage1.vm.network :private_network, ip: "192.168.22.5" # External Network
    storage1.vm.network :private_network, ip: "172.16.33.5"  # Management Network (USE)
    storage1.vm.network :private_network, ip: "172.16.44.5"  # Storage Network (USE)
    storage1.vm.hostname = "storage1"
  end
  config.vm.define "network" do |network|
    network.vm.network :private_network, ip: "192.168.11.6" # Tunnel Network (USE)
    network.vm.network :private_network, ip: "192.168.22.6" # External Network (USE)
    network.vm.network :private_network, ip: "172.16.33.6"  # Management Network (USE)
    network.vm.network :private_network, ip: "172.16.44.6"  # Storage Network
    network.vm.hostname = "network"
  end
  config.vm.define "compute1" do |compute1|
    compute1.vm.network :private_network, ip: "192.168.11.7" # Tunnel Network (USE)
    compute1.vm.network :private_network, ip: "192.168.22.7" # External Network
    compute1.vm.network :private_network, ip: "172.16.33.7"  # Management Network (USE)
    compute1.vm.network :private_network, ip: "172.16.44.7"  # Storage Network (USE)
    compute1.vm.hostname = "compute1"
  end
  config.vm.define "swiftstore1" do |swiftstore1|
    swiftstore1.vm.network :private_network, ip: "192.168.11.8" # Tunnel Network
    swiftstore1.vm.network :private_network, ip: "192.168.22.8" # External Network
    swiftstore1.vm.network :private_network, ip: "172.16.33.8"  # Management Network (USE)
    swiftstore1.vm.network :private_network, ip: "172.16.44.8"  # Storage Network (USE)
    swiftstore1.vm.hostname = "swiftstore1"
  end
  config.vm.define "swiftstore2" do |swiftstore2|
    swiftstore2.vm.network :private_network, ip: "192.168.11.9" # Tunnel Network
    swiftstore2.vm.network :private_network, ip: "192.168.22.9" # External Network
    swiftstore2.vm.network :private_network, ip: "172.16.33.9"  # Management Network (USE)
    swiftstore2.vm.network :private_network, ip: "172.16.44.9"  # Storage Network (USE)
    swiftstore2.vm.hostname = "swiftstore2"
  end
  config.vm.define "swiftstore3" do |swiftstore3|
    swiftstore3.vm.network :private_network, ip: "192.168.11.10" # Tunnel Network
    swiftstore3.vm.network :private_network, ip: "192.168.22.10" # External Network
    swiftstore3.vm.network :private_network, ip: "172.16.33.10"  # Management Network (USE)
    swiftstore3.vm.network :private_network, ip: "172.16.44.10"  # Storage Network (USE)
    swiftstore3.vm.hostname = "swiftstore3"
  end
#  config.vm.define "tempest" do |tempest|
#    tempest.vm.network :private_network, ip: "192.168.11.11" # Tunnel Network
#    tempest.vm.network :private_network, ip: "192.168.22.11" # External Network
#    tempest.vm.network :private_network, ip: "172.16.33.11"  # Management Network
#    tempest.vm.network :private_network, ip: "172.16.44.11"  # Storage Network
#    tempest.vm.hostname = "tempest"
#  end

  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
#  config.vm.box = "ubuntu/trusty64"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080
#  config.vm.network 'forwarded_port', guest: 80, host: 8080
#  config.vm.network 'forwarded_port', guest: 443, host: 8443

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # 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"

  # 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 = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # 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
end
