This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 155
/
Vagrantfile
71 lines (64 loc) · 2.65 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
%w{RAX_USERNAME RAX_API_KEY VAGRANT_ADMIN_PASSWORD}.each do |var|
abort "Please set the environment variable #{var} in order to run the test" unless ENV.key? var
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "dummy"
config.vm.define :ubuntu do |ubuntu|
ubuntu.ssh.private_key_path = '~/.ssh/id_rsa'
ubuntu.vm.provider :rackspace do |rs|
rs.username = ENV['RAX_USERNAME']
rs.admin_password = ENV['VAGRANT_ADMIN_PASSWORD']
rs.api_key = ENV['RAX_API_KEY']
rs.flavor = /1 GB Performance/
rs.image = /Ubuntu/
rs.rackspace_region = :iad
rs.public_key_path = '~/.ssh/id_rsa.pub'
end
end
config.vm.define :centos do |centos|
centos.ssh.private_key_path = '~/.ssh/id_rsa'
centos.ssh.pty = true
centos.vm.provider :rackspace do |rs|
rs.username = ENV['RAX_USERNAME']
rs.admin_password = ENV['VAGRANT_ADMIN_PASSWORD']
rs.api_key = ENV['RAX_API_KEY']
rs.flavor = /1 GB Performance/
rs.image = /^CentOS/ # Don't match OnMetal - CentOS
rs.rackspace_region = :iad
rs.public_key_path = '~/.ssh/id_rsa.pub'
rs.init_script = 'sed -i\'.bk\' -e \'s/^\(Defaults\s\+requiretty\)/# \1/\' /etc/sudoers'
end
end
if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.6.0')
config.vm.define :windows do |windows|
windows.vm.provision :shell, :inline => 'Write-Output "WinRM is working!"'
windows.vm.communicator = :winrm
windows.winrm.username = 'Administrator'
windows.winrm.password = ENV['VAGRANT_ADMIN_PASSWORD']
begin
windows.winrm.transport = :ssl
windows.winrm.ssl_peer_verification = false
rescue
puts "Warning: Vagrant #{Vagrant::VERSION} does not support WinRM over SSL."
end
windows.vm.synced_folder ".", "/vagrant", disabled: true
windows.vm.provider :rackspace do |rs|
rs.username = ENV['RAX_USERNAME']
rs.api_key = ENV['RAX_API_KEY']
rs.admin_password = ENV['VAGRANT_ADMIN_PASSWORD']
rs.flavor = /2 GB Performance/
rs.image = 'Windows Server 2012'
rs.rackspace_region = ENV['RAX_REGION'] ||= 'dfw'
rs.init_script = File.read 'bootstrap.cmd'
end
end
end
end