Skip to content
Browse files

fixed the environment variable gem_home for executing local vagrant c…

…ommand
  • Loading branch information...
1 parent 21f37b3 commit 268522d8849db64549276dd9f9525ceca3992eb5 @jedi4ever committed
View
7 README
@@ -16,13 +16,14 @@ ALPHA CODE: -> you're on your own....
Installation:
=============
0) To sandbox everything, and avoid root acces , source the veewee.ENV file .
- This will set your VBOX_HOME_DIR=$VEEWEE/tmp, GEM_PATH=$VEEWEE, GEM_HOME=$VEEWEE
+ This will set your VBOX_HOME_DIR=$VEEWEE/tmp, GEM_PATH=$VEEWEE/gems, GEM_HOME=$VEEWEE/gems
$ git clone https://github.com/jedi4ever/veewee.git
$ cd veewee
$ . veewee.ENV
1) Install all the necessary gems (sandboxes in $VEEWEE/gems)
-$ gem install rake virtualbox vagrant popen4 net-ssh net-scp
+$ gem install rake vagrant popen4
+-> vagrant installs virtualbox,net-ssh, net-scp too
2) List all templates
$ rake templates
@@ -62,7 +63,7 @@ Veewee::Session.declare( {
:kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
:ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
:ssh_host_port => "2222", :ssh_guest_port => "22",
- :sudo_cmd => "echo %p|sudo -S sh %f",
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
:shutdown_cmd => "shutdown -H",
:postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
}
View
4 Rakefile
@@ -1,5 +1,5 @@
-ENV['GEM_PATH']=File.dirname(__FILE__)
-ENV['GEM_HOME']=File.dirname(__FILE__)
+ENV['GEM_PATH']=File.join(File.dirname(__FILE__),"gems")
+ENV['GEM_HOME']=File.join(File.dirname(__FILE__),"gems")
def check_environment
begin
View
3 lib/veewee/export.rb
@@ -8,7 +8,6 @@ def self.vagrant(boxname,boxdir,definition)
#Check if box already exists
vm=VirtualBox::VM.find(boxname)
-
#We need to shutdown first
if vm.running?
puts "Vagrant requires the box to be shutdown, before it can export"
@@ -37,7 +36,7 @@ def self.vagrant(boxname,boxdir,definition)
export_command="vagrant package --base '#{boxname}' --output '#{box_path}'"
puts "Manually type:"
puts "#{export_command}"
- #Veewee::Shell.execute("#{export_command}") hmm, needs to get the gem_home set?
+ Veewee::Shell.execute("#{export_command}") #hmm, needs to get the gem_home set?
puts
puts "To import it into vagrant type:"
View
1 lib/veewee/session.rb
@@ -389,7 +389,6 @@ def self.transaction(boxname,name,checksum_params, &block)
end
end
-
def self.list_ostypes
puts
View
7 lib/veewee/shell.rb
@@ -3,6 +3,11 @@
module Veewee
class Shell
+ def self.execute2(command,options = {})
+
+ IO.popen("#{command}") { |f| print f }
+ end
+
#pty allows you to gradually see the output of a local command
#http://www.shanison.com/?p=415
def self.execute(command, options = {} )
@@ -20,7 +25,7 @@ def self.execute(command, options = {} )
end
#occassinally fails with 'no child processes
- def self.execute2(command, options = {} )
+ def self.execute3(command, options = {} )
defaults= { :port => "22", :exitcode => "0", :user => "root"}
options=defaults.merge(options)
View
2 templates/CentOS-4.8-i386/ks.cfg
@@ -42,4 +42,4 @@ lvm2
/usr/sbin/groupadd vagrant
/usr/sbin/useradd vagrant -g vagrant -G wheel
echo "vagrant"|passwd --stdin vagrant
-echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
+echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
View
4 templates/CentOS-4.8-i386/postinstall.sh
@@ -21,10 +21,6 @@ rm ruby-enterprise-1.8.7-2010.02.tar.gz
#Installing chef
/opt/ruby/bin/gem install chef
-#Enable sudo
-echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
-# Defaults requiretty
-
#Installing vagrant keys
mkdir /home/vagrant/.ssh
chmod 600 /home/vagrant/.ssh
View
3 templates/CentOS-5.5-i386/postinstall.sh
@@ -21,9 +21,6 @@ rm ruby-enterprise-1.8.7-2010.02.tar.gz
#Installing chef
/opt/ruby/bin/gem install chef
-#Enable sudo
-echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
-# Defaults requiretty
#Installing vagrant keys
mkdir /home/vagrant/.ssh
View
2 veewee.ENV
@@ -1,5 +1,5 @@
export GEM_HOME=`pwd`/gems
-export GEM_PATH=$GEM_HOME
+export GEM_PATH=`pwd`/gems
export RUBY_HOME="/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/"
export PATH=$RUBY_HOME/bin:$PATH

0 comments on commit 268522d

Please sign in to comment.
Something went wrong with that request. Please try again.