MissionCriticalCloud/vagrant-cloudstack

View on GitHub
functional-tests/rsync/Vagrantfile.advanced_networking

Summary

Maintainability
Test Coverage
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'

Vagrant.require_version '>= 1.5.0'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = ENV['LINUX_TEMPLATE_NAME']

  config.vm.synced_folder ".", "/vagrant", type: "rsync",
  rsync__exclude: [".git/", "vendor"]

  config.vm.provider :cloudstack do |cloudstack, override|
    cloudstack.display_name = ENV['TEST_NAME']

    cloudstack.host       = ENV['CLOUDSTACK_HOST']
    cloudstack.path       = '/client/api'
    cloudstack.port       = '443'
    cloudstack.scheme     = 'https'
    cloudstack.api_key    = ENV['CLOUDSTACK_API_KEY']
    cloudstack.secret_key = ENV['CLOUDSTACK_SECRET_KEY']
    cloudstack.expunge_on_destroy = ENV['EXPUNGE_ON_DESTROY']=="true"

    cloudstack.zone_name             = ENV['ZONE_NAME']
    cloudstack.network_name          = ENV['NETWORK_NAME']
    cloudstack.service_offering_name = ENV['SERVICE_OFFERING_NAME']

    cloudstack.pf_ip_address         = ENV['PUBLIC_SOURCE_NAT_IP']
    cloudstack.pf_trusted_networks   = ENV['SOURCE_CIDR']
    cloudstack.pf_open_firewall      = false

    unless ENV['SSH_KEY'].nil?
        cloudstack.ssh_key               = ENV['SSH_KEY']
        cloudstack.ssh_user              = ENV['SSH_USER']
    end
  end

end