9fa6a79fc482b9e0fbf1ec233fee62eaaa301427
[releng/builder.git] / vagrant / integration-robotframework / 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   # Fedora and EL systems default to requiring tty for sudo
18   # This should have been disabled with the Vagrant ready
19   # base box conversion (see rackspace-convert-base vagrant)
20   # but just to be safe
21   config.ssh.pty = true
22
23   # make sure to set the following in your
24   # ~/.vagrant.d/boxes/dummy/0/rackspace/Vagrantfile
25   # rs.username
26   # rs.api_key
27   # rs.rackspace_region
28   #
29   # If you are not using an SSH token / smartcard also set this
30   # rs.key_name
31   # config.ssh.private_key_path -- set this outside the rackspace block
32   #         in your base box
33   config.vm.provider :rackspace do |rs|
34     # create these base builds always on the smallest system possible
35     rs.flavor = 'general1-1'
36
37     # allow for switching to ORD cloud but default to DFW
38     if (ENV['RSREGION'] == 'ord')
39       rs.rackspace_region = :ord
40     else
41       rs.rackspace_region = :dfw
42     end
43
44     # Default the CentOS 6.5 - Vagrant ready image unless overriden by a RSIMAGE
45     # environment variable
46     if ENV['RSIMAGE']
47       rs.image = ENV['RSIMAGE']
48     else
49       rs.image = 'CentOS 6.5 - Vagrant ready'
50     end
51   end
52
53   # Explicitlly set default shared folder and load lib folder
54   config.vm.synced_folder ".", "/vagrant"
55   config.vm.synced_folder "../lib/", "/vagrant/lib"
56
57   # run our bootstrapping for the robotframework system
58   config.vm.provision 'shell', path: 'bootstrap.sh'
59
60
61   #################
62   # LF NETWORKING #
63   #################
64
65   if ENV['LFNETWORK']
66     # reconfigure the network setup to support our special private setup
67     config.vm.provision 'shell', path: '../lib/lf-networking/configure_lf_infra.sh',
68       args: ENV['RSSUBDOMAIN']
69   end
70
71
72   #################
73   # FINAL CLEANUP #
74   #################
75
76   # set RSRESEAL to... anything if you want to snap an image of this box
77   # not setting the environment variable will cause the system to come
78   # up fully and not be in a resealable state
79   if ENV['RSRESEAL']
80     config.vm.provision 'shell', path: '../lib/system_reseal.sh'
81   end
82 end