Update basic-builder definition for private cloud 95/38295/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Mon, 2 May 2016 20:54:33 +0000 (13:54 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Mon, 2 May 2016 20:54:33 +0000 (13:54 -0700)
Change-Id: Ib76015b441632471ce4a0d6c46e6895faec12d2e
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
vagrant/basic-builder/Vagrantfile
vagrant/basic-builder/bootstrap.sh

index 54040185afe825e8c870e2dfaf5eff853e12491b..0622a7a78f48906077194de13b5b80efcc18d779 100644 (file)
@@ -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'
 
   #################
index 14309966a47eb8b90a2ca826585b693c2444f841..a461bb0f602935096397558f7782ef50ab096330 100644 (file)
@@ -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} \