require 'vagrant-openstack-provider' Vagrant.configure('2') do |config| config.vm.box = 'openstack' config.vm.box_url = 'https://github.com/ggiamarchi/vagrant-openstack/raw/master/source/dummy.box' config.ssh.private_key_path = ENV['OS_KEYPAIR_PRIVATE_KEY'] config.ssh.pty = true config.ssh.shell = ENV['OS_SSH_SHELL'] config.vm.provider :openstack do |os| os.username = ENV['OS_USERNAME'] os.password = ENV['OS_PASSWORD'] os.openstack_auth_url = ENV['OS_AUTH_URL'] os.openstack_compute_url = ENV['OS_COMPUTE_URL'] os.openstack_network_url = ENV['OS_NETWORK_URL'] os.tenant_name = ENV['OS_TENANT_NAME'] os.ssh_timeout = ENV['OS_SSH_TIMEOUT'].to_i os.sync_method = ENV['OS_SYNC_METHOD'] os.flavor = ENV['OS_FLAVOR'] os.image = ENV['OS_IMAGE'] os.ssh_username = ENV['OS_SSH_USERNAME'] os.keypair_name = ENV['OS_KEYPAIR_NAME'] os.floating_ip_pool = ENV['OS_FLOATING_IP_POOL'] end config.vm.define 'test-basic' do |test| test.vm.provider :openstack do |os| os.floating_ip = ENV['OS_FLOATING_IP'] os.floating_ip_pool = nil end test.vm.provision 'shell', inline: 'echo "SUCCESS" > /tmp/test_shell_provision' end config.vm.define 'test-floating-ip-pool' do |test| test.vm.provider :openstack do |os| os.floating_ip = nil os.floating_ip_pool = ENV['OS_FLOATING_IP_POOL'] end test.vm.provision 'shell', inline: 'echo "SUCCESS" > /tmp/test_shell_provision' end config.vm.define 'test-ssh-public-key-path' do |test| test.vm.provider :openstack do |os| os.keypair_name = nil os.public_key_path = ENV['OS_PUBLIC_KEY_PATH'] end test.vm.provision 'shell', inline: 'echo "SUCCESS" > /tmp/test_shell_provision' end config.vm.define 'test-availabilty-zone' do |test| test.vm.provider :openstack do |os| os.availability_zone = ENV['OS_AZ'] end test.vm.provision 'shell', inline: 'echo "SUCCESS" > /tmp/test_shell_provision' end end