From: Andrew Grimberg Date: Mon, 2 May 2016 20:54:33 +0000 (-0700) Subject: Update basic-builder definition for private cloud X-Git-Tag: release/beryllium-sr2~19 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F38295%2F1;p=releng%2Fbuilder.git Update basic-builder definition for private cloud Change-Id: Ib76015b441632471ce4a0d6c46e6895faec12d2e Signed-off-by: Andrew Grimberg --- 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' ################# diff --git a/vagrant/basic-builder/bootstrap.sh b/vagrant/basic-builder/bootstrap.sh index 14309966a..a461bb0f6 100644 --- a/vagrant/basic-builder/bootstrap.sh +++ b/vagrant/basic-builder/bootstrap.sh @@ -2,11 +2,6 @@ # 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} \