-# -*- mode: ruby -*-
-# vi: set ft=ruby sw=2 ts=2 sts=2 et :
-
-# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
-VAGRANTFILE_API_VERSION = "2"
-
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
- # root off of the rackspace provider dummy box
- config.vm.box = "dummy"
-
- # rackspace systems even with cloud-init
- # don't seem to have the cloud init user ${osname}
- # getting the ssh key for some reason, root does
- # so use that
- config.ssh.username = 'root'
-
- # DEPRECATED
- # ==========
- #
- # NOTE: The Rackspace provider section is deprecated as we are moving into a
- # private OpenStack cloud. It may be revived after we've migrated and have a
- # chance to do work to reconfigure the Rackspace public cloud to work for
- # burst access
- #
- # make sure to set the following in your
- # ~/.vagrant.d/boxes/dummy/0/rackspace/Vagrantfile
- # rs.username
- # rs.api_key
- # rs.rackspace_region
- #
- # If you are not using a SSH token / smartcard also set this
- # rs.key_name
- # config.ssh.private_key_path -- set this outside the rackspace block
- # in your base box
- config.vm.provider :rackspace do |rs|
- # create these base builds always on the smallest system possible
- rs.flavor = 'general1-1'
-
- # allow for switching to ORD cloud but default to DFW
- if (ENV['RSREGION'] == 'ord')
- rs.rackspace_region = :ord
- else
- rs.rackspace_region = :dfw
- end
-
- # Default to the Fedora 20 image unless overridden by a RSIMAGE
- # environment variable
- if ENV['IMAGE']
- rs.image = ENV['IMAGE']
- else
- rs.image = 'Fedora 20 (Heisenbug) (PVHVM)'
- end
- end
- # /DEPRECATED
-
- # Configuration used by ODL Private cloud
- # Should be mostly usable by any OpenStack cloud that can
- # utilize upstream cloud images
- config.vm.provider :openstack do |os, override|
- if ENV['BOX']
- override.vm.box = ENV['BOX']
- else
- override.vm.box = 'dummy'
- end
- config.ssh.username = 'centos'
- os.flavor = 'm1.small'
-
- # require an IMAGE to be passed in
- # IMAGE must be a human name and not an image ID!
- if ENV['IMAGE']
- os.image = ENV['IMAGE']
- else
- os.image = 'BAD IMAGE'
- override.ssh.username = 'baduser'
- end
-
- case ENV['IMAGE']
- when /.*ubuntu.*/i
- override.ssh.username = 'ubuntu'
-
- when /.*fedora.*/i
- override.ssh.username = 'fedora'
-
- # take care of the tty requirement by fedora for sudo
- os.user_data = "#!/bin/bash
-/bin/sed -i 's/ requiretty/ !requiretty/' /etc/sudoers;"
-
- when /.*centos.*/i
- override.ssh.username = 'centos'
-
- # take care of the tty requirement by centos for sudo
- os.user_data = "#!/bin/bash
-/bin/sed -i 's/ requiretty/ !requiretty/' /etc/sudoers;"
- end
-
- end
-
- # Do a full system update and enable enforcing if needed
- config.vm.provision 'shell', path: '../lib/baseline.sh'
-
- # Execute a system clean-up in prep for imaging so that this base
- # image can be used for other Rackspace Vagrant configurations
- config.vm.provision 'shell', path: '../lib/system_reseal.sh'
-end