-
Notifications
You must be signed in to change notification settings - Fork 7
/
Vagrantfile.packaged
90 lines (65 loc) · 2.87 KB
/
Vagrantfile.packaged
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant plugins that need to be installed. Versions will vary.
# vagrant-libvirt (0.0.32) - if using libvirt
# vagrant-mutate (1.0.4) - if using libvirt
# vagrant-proxyconf (1.5.2) - if behind a proxy server
# Used by vagrant-proxyconf
use_proxy = !((ENV['http_proxy'].nil? || ENV['http_proxy'].empty?) &&
(ENV['https_proxy'].nil? || ENV['https_proxy'].empty?))
Vagrant.configure(2) do |config|
# Configure plugins, using the proxy plugin
# https://github.com/tmatilai/vagrant-proxyconf/
if use_proxy
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = ENV['http_proxy']
config.proxy.https = ENV['https_proxy']
config.proxy.no_proxy = ENV['no_proxy']
else
raise "vagrant-proxyconf (https://github.com/tmatilai/vagrant-proxyconf/) is not installed and proxy being used"
end
end
# Use NFS synced folder, make sure have installed NFS server on host
config.vm.synced_folder "/opt/git", "/opt/git", type: "nfs"
# config.vm.network :public_network
# This check does NOT work if they use '--provider' :(
if ENV['VAGRANT_DEFAULT_PROVIDER'] == 'libvirt'
# ******************* Start Libvirt ******************************
puts("Assuming provider is libvirt...")
# Assumption here is have converted the 'ubuntu/trusty64' Virtualbox box to a
# libvirt format using 'vagrant mutate' (which needs to be installed) and
# named the converted box 'trusty64'
# https://github.com/pradels/vagrant-libvirt
# https://github.com/sciurus/vagrant-mutate
# Check for required plugins
unless Vagrant.has_plugin?("vagrant-libvirt")
raise 'vagrant-libvirt (https://github.com/pradels/vagrant-libvirt) is not installed'
end
unless Vagrant.has_plugin?("vagrant-mutate")
raise 'vagrant-mutate (https://github.com/sciurus/vagrant-mutate) is not installed'
end
config.vm.box = "devstack-gate"
# We use libvirt to have nested virtualization
config.vm.provider :libvirt do |domain|
domain.memory = 8192
domain.cpus = 4
domain.nested = true
domain.volume_cache = 'none'
end
# This might be needed for Ansible
config.vm.network :private_network, ip: "192.168.32.100"
# ******************* End Libvirt ******************************
else
# ******************* Start Virtualbox ******************************
puts("Assuming provider is Virtualbox...")
# For Virtualbox using 'ubuntu/trusty64'
config.vm.box = "devstack-gate"
config.vm.provider "virtualbox" do |domain|
domain.memory = 8192
domain.cpus = 4
end
# This might be needed for Ansible
config.vm.network :private_network, ip: "192.168.64.100"
# ******************* End Virtualbox ******************************
end
end