# config.ssh.private_key_path -- set this outside the openstack block
# in your base box
config.vm.provider :openstack do |os, override|
- # Default the CentOS 6.5 - Vagrant ready image unless overriden by a RSIMAGE
- # environment variable
+ 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 = 'CentOS 7 - baseline - 20151215'
+ 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
config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder "../lib/", "/vagrant/lib"
- # run our bootstrapping for the ovsdb-devstack system
+ # Do a full system update and enable enforcing if needed
+ config.vm.provision 'shell', path: '../lib/baseline.sh'
+
+ # run our bootstrapping
config.vm.provision 'shell', path: 'bootstrap.sh'
#################
# vim: sw=4 ts=4 sts=4 et tw=72 :
-yum clean all
-
-# Make sure the system is fully up to date
-yum update -q -y
-
# The following packages are not needed by all projects, but they are
# needed by enough to make them useful everywhere
yum install -q -y @development perl-{Digest-SHA,ExtUtils-MakeMaker} \