2 # vi: set ft=ruby sw=2 ts=2 sts=2 et :
4 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5 VAGRANTFILE_API_VERSION = "2"
7 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8 # root off of the rackspace provider dummy box
9 config.vm.box = "dummy"
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
15 config.ssh.username = 'root'
20 # NOTE: The Rackspace provider section is deprecated as we are moving into a
21 # private OpenStack cloud. It may be revived after we've migrated and have a
22 # chance to do work to reconfigure the Rackspace public cloud to work for
25 # make sure to set the following in your
26 # ~/.vagrant.d/boxes/dummy/0/rackspace/Vagrantfile
31 # If you are not using a SSH token / smartcard also set this
33 # config.ssh.private_key_path -- set this outside the rackspace block
35 config.vm.provider :rackspace do |rs|
36 # create these base builds always on the smallest system possible
37 rs.flavor = 'general1-1'
39 # allow for switching to ORD cloud but default to DFW
40 if (ENV['RSREGION'] == 'ord')
41 rs.rackspace_region = :ord
43 rs.rackspace_region = :dfw
46 # Default to the Fedora 20 image unless overridden by a RSIMAGE
47 # environment variable
49 rs.image = ENV['IMAGE']
51 rs.image = 'Fedora 20 (Heisenbug) (PVHVM)'
56 # Configuration used by ODL Private cloud
57 # Should be mostly usable by any OpenStack cloud that can
58 # utilize upstream cloud images
59 config.vm.provider :openstack do |os, override|
61 override.vm.box = ENV['BOX']
63 override.vm.box = 'dummy'
65 config.ssh.username = 'centos'
66 os.flavor = 'm1.small'
68 # require an IMAGE to be passed in
69 # IMAGE must be a human name and not an image ID!
71 os.image = ENV['IMAGE']
73 os.image = 'BAD IMAGE'
74 override.ssh.username = 'baduser'
79 override.ssh.username = 'ubuntu'
82 override.ssh.username = 'fedora'
84 # take care of the tty requirement by fedora for sudo
85 os.user_data = "#!/bin/bash
86 /bin/sed -i 's/ requiretty/ !requiretty/' /etc/sudoers;"
89 override.ssh.username = 'centos'
91 # take care of the tty requirement by centos for sudo
92 os.user_data = "#!/bin/bash
93 /bin/sed -i 's/ requiretty/ !requiretty/' /etc/sudoers;"
98 # Do a full system update and enable enforcing if needed
99 config.vm.provision 'shell', path: '../lib/baseline.sh'
101 # Execute a system clean-up in prep for imaging so that this base
102 # image can be used for other Rackspace Vagrant configurations
103 config.vm.provision 'shell', path: '../lib/system_reseal.sh'