54b001f3f37c30be3195a6ec5e8a468138e54b91
[releng/builder.git] / vagrant / ubuntu-mininet-ovs-2.3 / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby sw=2 ts=2 sts=2 et :
3
4 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5 VAGRANTFILE_API_VERSION = "2"
6
7 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8   # root off of the rackspace provider dummy box
9   config.vm.box = "dummy"
10
11   # rackspace systems, even with cloud-init
12   # don't seem to have the cloud int user ${osname} (or similar)
13   # getting the ssh key for some reason, root does for sure
14   # so use that
15   config.ssh.username = 'root'
16
17   # Only baseline image should have config.ssh.pty = true
18   # Ensure we disable it.
19   config.ssh.pty = false
20
21   # make sure to set the following in your
22   # ~/.vagrant.d/boxes/dummy/0/rackspace/Vagrantfile
23   # rs.username
24   # rs.api_key
25   # rs.rackspace_region
26   #
27   # If you are not using an SSH token / smartcard also set this
28   # rs.key_name
29   # config.ssh.private_key_path -- set this outside the rackspace block
30   #         in your base box
31   config.vm.provider :rackspace do |rs|
32     # create these base builds always on the smallest system possible
33     rs.flavor = 'general1-1'
34
35     # allow for switching to ORD cloud but default to DFW
36     if (ENV['RSREGION'] == 'ord')
37       rs.rackspace_region = :ord
38     else
39       rs.rackspace_region = :dfw
40     end
41
42     # Default the Ubuntu 14.04 - Vagrant ready image unless overriden by a RSIMAGE
43     # environment variable
44     if ENV['RSIMAGE']
45       rs.image = ENV['RSIMAGE']
46     else
47       rs.image = 'Ubuntu 14.04 - Vagrant ready'
48     end
49   end
50
51   # Explicitlly set default shared folder and load lib folder
52   config.vm.synced_folder ".", "/vagrant"
53   config.vm.synced_folder "../lib/", "/vagrant/lib"
54
55   # run our bootstrapping for the system
56   config.vm.provision 'shell', path: 'bootstrap.sh'
57
58
59   #################
60   # LF NETWORKING #
61   #################
62
63   if ENV['LFNETWORK']
64     # reconfigure the network setup to support our special private setup
65     config.vm.provision 'shell', path: '../lib/lf-networking/configure_lf_infra.sh',
66       args: ENV['RSSUBDOMAIN']
67   end
68
69
70   #################
71   # FINAL CLEANUP #
72   #################
73
74   # set RSRESEAL to... anything if you want to snap an image of this box
75   # not setting the environment variable will cause the system to come
76   # up fully and not be in a resealable state
77   if ENV['RSRESEAL']
78     config.vm.provision 'shell', path: '../lib/system_reseal.sh'
79   end
80 end