X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=vagrant%2Fbasic-builder%2FVagrantfile;h=0622a7a78f48906077194de13b5b80efcc18d779;hb=596a36d6b9ab6e630eef77a165f234cd812fab9c;hp=54040185afe825e8c870e2dfaf5eff853e12491b;hpb=84dd652a90fa624caa2499eaef4c9ede9d7d4286;p=releng%2Fbuilder.git diff --git a/vagrant/basic-builder/Vagrantfile b/vagrant/basic-builder/Vagrantfile index 54040185a..0622a7a78 100644 --- a/vagrant/basic-builder/Vagrantfile +++ b/vagrant/basic-builder/Vagrantfile @@ -25,17 +25,40 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # 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 @@ -43,7 +66,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 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' #################