# -*- 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' machines = { 'linux-box' => { 'template' => ENV['LINUX_TEMPLATE_NAME'], 'communicator' => 'ssh', 'rsync_disabled' => true }, 'windows-box' => { 'template' => ENV['WINDOWS_TEMPLATE_NAME'], 'communicator' => 'winrm', 'rsync_disabled' => true } } Vagrant.configure(VAGRANTFILE_API_VERSION) do |global_config| machines.each_pair do |name, options| global_config.vm.define name do |config| config.vm.box = options['template'] config.vm.communicator = options['communicator'] config.winrm.retry_delay = 30 config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".git/", "vendor"], disabled: options['rsync_disabled'] config.vm.provider :cosmic do |cosmic, override| cosmic.display_name = ENV['TEST_NAME'] cosmic.host = ENV['COSMIC_HOST'] cosmic.path = '/client/api' cosmic.port = '443' cosmic.scheme = 'https' cosmic.api_key = ENV['COSMIC_API_KEY'] cosmic.secret_key = ENV['COSMIC_SECRET_KEY'] cosmic.expunge_on_destroy = ENV['EXPUNGE_ON_DESTROY']=="true" cosmic.zone_name = ENV['ZONE_NAME'] cosmic.network_name = ENV['NETWORK_NAME'] cosmic.service_offering_name = ENV['SERVICE_OFFERING_NAME'] cosmic.disk_offering_name = ENV['DISK_OFFERING_NAME'] cosmic.pf_ip_address = ENV['PUBLIC_SOURCE_NAT_IP'] cosmic.pf_public_port = options['public_port'] cosmic.pf_private_port = options['private_port'] cosmic.pf_trusted_networks = ENV['SOURCE_CIDR'] cosmic.pf_open_firewall = false cosmic.ssh_key = ENV['SSH_KEY'] unless ENV['SSH_KEY'].nil? cosmic.ssh_user = ENV['SSH_USER'] unless ENV['SSH_USER'].nil? cosmic.vm_user = ENV['WINDOWS_USER'] unless ENV['WINDOWS_USER'].nil? end end end end