Add the "basic builder" image definition
[releng/builder.git] / vagrant / basic-builder / 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     # Default the CentOS 7 - Vagrant ready image unless overriden by a RSIMAGE
38     # environment variable
39     if ENV['RSIMAGE']
40       rs.image = ENV['RSIMAGE']
41     else
42       rs.image = 'CentOS 7 - Vagrant ready'
43     end
44   end
45
46   # run our bootstrapping for the ovsdb-devstack system
47   config.vm.provision 'shell', path: 'bootstrap.sh'
48
49   # set RSRESEAL to... anything if you want to snap an image of this box
50   # not setting the environment variable will cause the system to come
51   # up fully and not be in a resealable state
52   if ENV['RSRESEAL']
53     config.vm.provision 'shell', path: 'system_reseal.sh'
54   end
55 end