Initial Vagrant configurations
[releng/builder.git] / vagrant / rackspace-convert-base / 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 init user ${osname}
13   # getting the ssh key for some reason, root does
14   # so use that
15   config.ssh.username = 'root'
16   
17   # Fedora and EL systems default to requiring a tty for sudo
18   config.ssh.pty = true
19
20   # The rackspace provider by default tries to rsync
21   # the local folder / vagrant box to /vagrant
22   # unfortunately, even with config.ssh.pty = true
23   # this fails because it doesn't recognize the pty requirement
24   # when doing the sudo based rsync (not that it needs to sudo
25   # when doing things as root). To avoid this, disable the
26   # default sync, we don't need it anyway.
27   config.vm.synced_folder '.', '/vagrant', :disabled => true
28
29   # make sure to set the following in your
30   # ~/.vagrant.d/boxes/dummy/0/rackspace/Vagrantfile
31   # rs.username
32   # rs.api_key
33   # rs.rackspace_region
34   #
35   # If you are not using a SSH token / smartcard also set this
36   # rs.key_name
37   # config.ssh.private_key_path  -- set this outside the rackspace block
38   #         in your base box
39   config.vm.provider :rackspace do |rs|
40     # create these base builds always on the smallest system possible
41     rs.flavor = 'performance1-1'
42
43     # Default to the Fedora 20 image unless overridden by a RSIMAGE
44     # environment variable
45     if ENV['RSIMAGE']
46       rs.image = ENV['RSIMAGE']
47     else
48       rs.image = 'Fedora 20 (Heisenbug) (PVHVM)'
49     end
50   end
51
52   # disable the default requiretty for sudo that Fedora and CentOS have
53   config.vm.provision 'shell', path: 'remove_requiretty.sh'
54
55   # Do a full system update and force enforcing on (it's in permissive
56   # by default in the rackspace base images)
57   config.vm.provision 'shell', path: 'bootstrap.sh'
58
59   # Execute a system clean-up in prep for imaging so that this base
60   # image can be used for other Rackspace Vagrant configurations
61   config.vm.provision 'shell', path: 'system_reseal.sh'
62 end