veewee 0.3.0.alpha8 → 0.3.0.alpha9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. data/Gemfile +5 -0
  2. data/Rakefile +41 -1
  3. data/bin/veewee +1 -1
  4. data/doc/kvm.md +9 -1
  5. data/doc/vagrant.md +5 -5
  6. data/lib/veewee/command/vagrant/basebox.rb +2 -0
  7. data/lib/veewee/command/vagrant/build.rb +3 -0
  8. data/lib/veewee/command/vagrant/export.rb +10 -0
  9. data/lib/veewee/command/vagrant/screenshot.rb +45 -0
  10. data/lib/veewee/command/virtualbox.rb +13 -0
  11. data/lib/veewee/config.rb +2 -2
  12. data/lib/veewee/provider/core/box/build.rb +29 -16
  13. data/lib/veewee/provider/core/box/exec.rb +4 -4
  14. data/lib/veewee/provider/core/box/floppy.rb +1 -1
  15. data/lib/veewee/provider/core/helper/iso.rb +14 -10
  16. data/lib/veewee/provider/core/helper/ssh.rb +6 -5
  17. data/lib/veewee/provider/core/helper/tcp.rb +5 -3
  18. data/lib/veewee/provider/kvm/box/destroy.rb +1 -1
  19. data/lib/veewee/provider/parallels/box/destroy.rb +1 -2
  20. data/lib/veewee/provider/virtualbox/box.rb +1 -0
  21. data/lib/veewee/provider/virtualbox/box/build.rb +1 -1
  22. data/lib/veewee/provider/virtualbox/box/destroy.rb +1 -3
  23. data/lib/veewee/provider/virtualbox/box/export_vagrant.rb +3 -2
  24. data/lib/veewee/provider/virtualbox/box/helper/console_type.rb +5 -5
  25. data/lib/veewee/provider/virtualbox/box/helper/natinterface.rb +1 -1
  26. data/lib/veewee/provider/virtualbox/box/screenshot.rb +24 -0
  27. data/lib/veewee/provider/virtualbox/box/up.rb +2 -3
  28. data/lib/veewee/provider/vmfusion/box/destroy.rb +1 -2
  29. data/lib/veewee/provider/vmfusion/box/helper/vnc.rb +1 -1
  30. data/lib/veewee/templates.rb +1 -1
  31. data/lib/veewee/version.rb +1 -1
  32. data/templates/CentOS-4.8-i386/definition.rb +1 -1
  33. data/templates/CentOS-5.5-i386-netboot/definition.rb +1 -1
  34. data/templates/CentOS-5.5-x86_64-netboot/definition.rb +1 -1
  35. data/templates/CentOS-5.7-i386-netboot/definition.rb +1 -1
  36. data/templates/CentOS-5.7-i386-netboot/ks.cfg +2 -0
  37. data/templates/CentOS-5.7-x86_64-netboot/definition.rb +1 -1
  38. data/templates/CentOS-5.7-x86_64-netboot/ks.cfg +3 -1
  39. data/templates/CentOS-5.8-i386-netboot/definition.rb +16 -0
  40. data/templates/CentOS-5.8-i386-netboot/ks.cfg +47 -0
  41. data/templates/CentOS-5.8-i386-netboot/postinstall.sh +53 -0
  42. data/templates/CentOS-5.8-i386/definition.rb +16 -0
  43. data/templates/CentOS-5.8-i386/ks.cfg +47 -0
  44. data/templates/CentOS-5.8-i386/postinstall.sh +53 -0
  45. data/templates/CentOS-5.8-x86_64-netboot/definition.rb +16 -0
  46. data/templates/CentOS-5.8-x86_64-netboot/ks.cfg +47 -0
  47. data/templates/CentOS-5.8-x86_64-netboot/postinstall.sh +53 -0
  48. data/templates/CentOS-5.8-x86_64/definition.rb +16 -0
  49. data/templates/CentOS-5.8-x86_64/ks.cfg +47 -0
  50. data/templates/CentOS-5.8-x86_64/postinstall.sh +60 -0
  51. data/templates/Debian-6.0.4-i386-netboot/ruby.sh +1 -1
  52. data/templates/Fedora-16-i386/definition.rb +1 -1
  53. data/templates/Fedora-16-x86_64/definition.rb +1 -1
  54. data/templates/archlinux-x86_64/definition.rb +1 -1
  55. data/templates/ubuntu-11.04-server-amd64/ruby.sh +4 -4
  56. data/templates/ubuntu-11.04-server-i386/postinstall.sh +12 -12
  57. data/templates/ubuntu-12.04-server-amd64-packages/definition.rb +3 -3
  58. data/templates/ubuntu-12.04-server-amd64/definition.rb +3 -3
  59. data/templates/ubuntu-12.04-server-i386/definition.rb +37 -0
  60. data/templates/ubuntu-12.04-server-i386/postinstall.sh +93 -0
  61. data/templates/ubuntu-12.04-server-i386/preseed.cfg +87 -0
  62. data/templates/windows-2008R2-amd64/definition.rb +1 -1
  63. metadata +20 -3
@@ -39,7 +39,7 @@ module Veewee
39
39
 
40
40
  if guessed_port.nil?
41
41
  ui.error "No free port available: tried #{min_port}..#{max_port}"
42
- exit -1
42
+ raise Veewee::Error, "No free port available: tried #{min_port}..#{max_port}"
43
43
  else
44
44
  ui.info "Found port #{guessed_port} available"
45
45
  end
@@ -52,9 +52,11 @@ module Veewee
52
52
  defaults={ :port => 22, :timeout => 2 , :pollrate => 5}
53
53
 
54
54
  options=defaults.merge(options)
55
+ timeout=options[:timeout]
56
+ timeout=ENV['VEEWEE_TIMEOUT'].to_i unless ENV['VEEWEE_TIMEOUT'].nil?
55
57
 
56
58
  begin
57
- Timeout::timeout(options[:timeout]) do
59
+ Timeout::timeout(timeout) do
58
60
  connected=false
59
61
  while !connected do
60
62
  begin
@@ -69,7 +71,7 @@ module Veewee
69
71
  end
70
72
  end
71
73
  rescue Timeout::Error
72
- raise 'timeout connecting to port'
74
+ raise "Timeout connecting to TCP port {options[:port]} exceeded #{timeout} secs."
73
75
  end
74
76
 
75
77
  return false
@@ -6,7 +6,7 @@ module Veewee
6
6
  def destroy(options={})
7
7
  if @connection.servers.all(:name => name).nil?
8
8
  env.ui.error "Error:: You tried to destroy a non-existing box '#{name}'"
9
- exit -1
9
+ raise Veewee::Error,"Error:: You tried to destroy a non-existing box '#{name}'"
10
10
  end
11
11
 
12
12
  self.poweroff if running?
@@ -5,8 +5,7 @@ module Veewee
5
5
 
6
6
  def destroy(options={})
7
7
  unless self.exists?
8
- ui.error "Error:: You tried to destroy a non-existing box '#{name}'"
9
- exit -1
8
+ raise Veewee::Error, "Error:: You tried to destroy a non-existing box '#{name}'"
10
9
  end
11
10
 
12
11
  if self.running?
@@ -5,6 +5,7 @@ require 'veewee/provider/virtualbox/box/create'
5
5
  require 'veewee/provider/virtualbox/box/halt'
6
6
  require 'veewee/provider/virtualbox/box/poweroff'
7
7
  require 'veewee/provider/virtualbox/box/destroy'
8
+ require 'veewee/provider/virtualbox/box/screenshot'
8
9
  require 'veewee/provider/virtualbox/box/ssh'
9
10
  require 'veewee/provider/virtualbox/box/validate_vagrant'
10
11
  require 'veewee/provider/virtualbox/box/export_vagrant'
@@ -7,7 +7,7 @@ module Veewee
7
7
  download_vbox_guest_additions_iso(options)
8
8
 
9
9
  unless definition.floppy_files.nil?
10
- unless self.shell_exec("java").status == 0
10
+ unless self.shell_exec("java -version").status == 0
11
11
  raise Veewee::Error,"This box contains floppyfiles, to create it you require to have java installed or have it in your path"
12
12
  end
13
13
  end
@@ -6,8 +6,7 @@ module Veewee
6
6
  def destroy(option={})
7
7
 
8
8
  unless self.exists?
9
- ui.error "Error:: You tried to destroy a non-existing box '#{name}'"
10
- exit -1
9
+ raise Veewee::Error, "Error:: You tried to destroy a non-existing box '#{name}'"
11
10
  end
12
11
 
13
12
  # If it has a save state,remove that first
@@ -53,7 +52,6 @@ module Veewee
53
52
  ui.info "We tried to delete the disk file via virtualbox '#{location} but failed"
54
53
  ui.info "Removing it manually"
55
54
  FileUtils.rm(location)
56
- exit -1
57
55
  end
58
56
  break
59
57
  end
@@ -54,12 +54,13 @@ module Veewee
54
54
  box_path=path1.relative_path_from(path2).to_s
55
55
 
56
56
  if File.exists?("#{box_path}")
57
- ui.info "box #{name}.box already exists"
58
- exit
57
+ raise Veewee::Error, "box #{name}.box already exists"
59
58
  end
60
59
 
61
60
  ui.info "Executing vagrant voodoo:"
62
61
  export_command="vagrant package --base '#{name}' --output '#{box_path}'"
62
+ export_command += " --include #{options["include"].join(',')}" unless options["include"].empty?
63
+ export_command += " --vagrantfile #{options["vagrantfile"].join(' ')}" unless options["vagrantfile"].empty?
63
64
  ui.info "#{export_command}"
64
65
  shell_exec("#{export_command}") #hmm, needs to get the gem_home set?
65
66
  ui.info ""
@@ -48,11 +48,11 @@ module Veewee
48
48
  env.logger.info "#{command}"
49
49
  sshresult=shell_exec("#{command}",{:mute => true})
50
50
  unless sshresult.stdout.index("E_ACCESSDENIED").nil?
51
- ui.error "There was an error typing the commands on the console"
52
- ui.error "Probably the VM did not get started."
53
- ui.error ""
54
- ui.error "#{sshresult.stdout}"
55
- exit -1
51
+ error= "There was an error typing the commands on the console"
52
+ error+="Probably the VM did not get started."
53
+ error+= ""
54
+ error+= "#{sshresult.stdout}"
55
+ raise Veewee::Error, error
56
56
  end
57
57
  end
58
58
 
@@ -4,7 +4,7 @@ module Veewee
4
4
  module BoxCommand
5
5
 
6
6
  def natinterface
7
- command="#{@vboxcmd} showvminfo --details --machinereadable '#{self.name}'"
7
+ command="#{@vboxcmd} showvminfo --details --machinereadable \"#{self.name}\""
8
8
  shell_results=shell_exec("#{command}")
9
9
 
10
10
  nic_id=shell_results.stdout.split(/\n/).grep(/^nic/).grep(/nat/)[0].split('=')[0][-1,1]
@@ -0,0 +1,24 @@
1
+ module Veewee
2
+ module Provider
3
+ module Virtualbox
4
+ module BoxCommand
5
+
6
+ def screenshot(filename,options={})
7
+ raise Veewee::Error, "The VM needs to exist before we can take a screenshot" unless self.exists?
8
+ raise Veewee::Error, "The VM needs to be running before we can test a screenshot" unless self.running?
9
+ # If the vm is not powered off, take a screenshot
10
+ if (self.exists? && self.running?)
11
+ ui.info "Saving screenshot of vm #{name} in #{filename}"
12
+
13
+ command="#{@vboxcmd} controlvm \"#{name}\" screenshotpng \"#{filename}\""
14
+ shell_exec("#{command}")
15
+ unless File.exists?(filename)
16
+ raise Veewee::Error,"Saving Screenshot #{filename} failed"
17
+ end
18
+ end
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
@@ -6,8 +6,7 @@ module Veewee
6
6
  def up(options={})
7
7
 
8
8
  unless self.exists?
9
- ui.error "Error:: You tried to up a non-existing box '#{name}'"
10
- exit -1
9
+ raise Veewee::Error, "Error:: You tried to up a non-existing box '#{name}'"
11
10
  end
12
11
 
13
12
  gui_enabled=options['nogui']==true ? false : true
@@ -30,7 +29,7 @@ module Veewee
30
29
  self.add_ssh_nat_mapping
31
30
  end
32
31
 
33
- self.suppress_messages
32
+ self.suppress_messages
34
33
 
35
34
  # Once assembled we start the machine
36
35
  env.logger.info "Started the VM with GUI Enabled? #{gui_enabled}"
@@ -5,8 +5,7 @@ module Veewee
5
5
 
6
6
  def destroy(options={})
7
7
  unless raw.exists?
8
- env.ui.error "Error:: You tried to destroy a non-existing box '#{name}'"
9
- exit -1
8
+ raise Veewee::Error, "Error:: You tried to destroy a non-existing box '#{name}'"
10
9
  end
11
10
 
12
11
  raw.halt if raw.state=="running"
@@ -29,7 +29,7 @@ module Veewee
29
29
 
30
30
  if guessed_port.nil?
31
31
  env.ui.info "No free VNC port available: tried #{min_port}..#{max_port}"
32
- exit -1
32
+ raise Veewee::Error, "No free VNC port available: tried #{min_port}..#{max_port}"
33
33
  else
34
34
  env.ui.info "Found VNC port #{guessed_port} available"
35
35
  end
@@ -46,7 +46,7 @@ module Veewee
46
46
  env.logger.debug("[Template] no templates found")
47
47
  end
48
48
 
49
- templates.each(&block)
49
+ Hash[templates.sort].each(&block)
50
50
  end
51
51
 
52
52
  private
@@ -4,5 +4,5 @@ end
4
4
 
5
5
  # Only set the version constant if it wasn't set before
6
6
  unless defined?(Veewee::VERSION)
7
- ::Veewee::VERSION="0.3.0.alpha8"
7
+ ::Veewee::VERSION="0.3.0.alpha9"
8
8
  end
@@ -3,7 +3,7 @@ Veewee::Definition.declare({
3
3
  :disk_size => '10140', :disk_format => 'VDI',:hostiocache => 'off',:ioapic => 'on', :pae => 'on',
4
4
  :os_type_id => 'RedHat',
5
5
  :iso_file => "CentOS-4.8-i386-bin-DVD.iso", :iso_src => "", :iso_md5 => "", :iso_download_timeout => 1000,
6
- :iso_download_instructions => "This iso is no more available, for instructions see http://isoredirect.centos.org/centos/4/isos/i386/",
6
+ :iso_download_instructions => "This iso is no more available, for instructions see http://vault.centos.org/4.8/isos/i386/",
7
7
  :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
8
8
  :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
9
9
  :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
@@ -8,7 +8,7 @@ Veewee::Session.declare({
8
8
  :iso_download_timeout => 1000,
9
9
  :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
10
10
  :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
11
- :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
11
+ :ssh_login_timeout => "600", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
12
12
  :ssh_host_port => "7222", :ssh_guest_port => "22",
13
13
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
14
14
  :shutdown_cmd => "/sbin/halt -h -p",
@@ -8,7 +8,7 @@ Veewee::Session.declare({
8
8
  :iso_download_timeout => 1000,
9
9
  :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
10
10
  :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
11
- :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
11
+ :ssh_login_timeout => "600", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
12
12
  :ssh_host_port => "7222", :ssh_guest_port => "22",
13
13
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
14
14
  :shutdown_cmd => "/sbin/halt -h -p",
@@ -8,7 +8,7 @@ Veewee::Session.declare({
8
8
  :iso_download_timeout => 1000,
9
9
  :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
10
10
  :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
11
- :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
11
+ :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
12
12
  :ssh_host_port => "7222", :ssh_guest_port => "22",
13
13
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
14
14
  :shutdown_cmd => "/sbin/halt -h -p",
@@ -37,6 +37,8 @@ reboot
37
37
  grub
38
38
  e2fsprogs
39
39
  lvm2
40
+ kernel-devel
41
+ kernel-headers
40
42
 
41
43
  %post
42
44
  /usr/sbin/groupadd vagrant
@@ -8,7 +8,7 @@ Veewee::Session.declare({
8
8
  :iso_download_timeout => 1000,
9
9
  :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
10
10
  :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
11
- :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
11
+ :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
12
12
  :ssh_host_port => "7222", :ssh_guest_port => "22",
13
13
  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
14
14
  :shutdown_cmd => "/sbin/halt -h -p",
@@ -1,7 +1,7 @@
1
1
  # Kickstart file automatically generated by anaconda.
2
2
 
3
3
  install
4
- url --url=http://mirror.atlanticmetro.net/centos/5.7/os/x86_64
4
+ url --url=http://vault.centos.org/5.7/os/x86_64
5
5
  lang en_US.UTF-8
6
6
  langsupport --default=en_US.UTF-8 en_US.UTF-8
7
7
  keyboard us
@@ -37,6 +37,8 @@ reboot
37
37
  grub
38
38
  e2fsprogs
39
39
  lvm2
40
+ kernel-devel
41
+ kernel-headers
40
42
 
41
43
  %post
42
44
  /usr/sbin/groupadd vagrant
@@ -0,0 +1,16 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1', :memory_size=> '384',
3
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
4
+ :os_type_id => 'RedHat',
5
+ :iso_file => "CentOS-5.8-i386-netinstall.iso",
6
+ :iso_src => "http://mirrors.arsc.edu/centos/5.8/isos/i386/CentOS-5.8-i386-netinstall.iso",
7
+ :iso_md5 => "3812865e426b55fde9a9931990e4a16c",
8
+ :iso_download_timeout => 1000,
9
+ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
10
+ :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
11
+ :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
12
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
13
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
14
+ :shutdown_cmd => "/sbin/halt -h -p",
15
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
16
+ })
@@ -0,0 +1,47 @@
1
+ # Kickstart file automatically generated by anaconda.
2
+
3
+ install
4
+ url --url=http://mirrors.arsc.edu/centos/5.8/os/i386/
5
+ lang en_US.UTF-8
6
+ langsupport --default=en_US.UTF-8 en_US.UTF-8
7
+ keyboard us
8
+ xconfig --card "VMWare" --videoram 16384 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16
9
+ network --device eth0 --bootproto dhcp
10
+ rootpw --iscrypted $1$vSG8FjAu$ekQ0grf16hS4G93HTPcco/
11
+ firewall --enabled --trust eth0 --ssh
12
+ selinux --enforcing
13
+ authconfig --enableshadow --enablemd5
14
+ timezone America/New_York
15
+ bootloader --location=mbr
16
+ # The following is the partition information you requested
17
+ # Note that any partitions you deleted are not expressed
18
+ # here so unless you clear all partitions first, this is
19
+ # not guaranteed to work
20
+ clearpart --all --drives=sda --initlabel
21
+ part /boot --fstype ext3 --size=100 --ondisk=sda
22
+ part pv.2 --size=0 --grow --ondisk=sda
23
+ volgroup VolGroup00 --pesize=32768 pv.2
24
+ logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=528 --grow --maxsize=1056
25
+ logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
26
+ reboot
27
+
28
+ %packages
29
+ #@ admin-tools
30
+ #@ text-internet
31
+ #@ dialup
32
+ #@ smb-server
33
+ #@ web-server
34
+ #@ printing
35
+ #@ server-cfg
36
+ @ core
37
+ grub
38
+ e2fsprogs
39
+ lvm2
40
+ kernel-devel
41
+ kernel-headers
42
+
43
+ %post
44
+ /usr/sbin/groupadd vagrant
45
+ /usr/sbin/useradd vagrant -g vagrant -G wheel
46
+ echo "vagrant"|passwd --stdin vagrant
47
+ echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
@@ -0,0 +1,53 @@
1
+ #http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
2
+ #kernel source is needed for vbox additions
3
+
4
+ date > /etc/vagrant_box_build_time
5
+
6
+ yum -y install gcc bzip2 make kernel-devel-`uname -r`
7
+ #yum -y update
8
+ #yum -y upgrade
9
+
10
+ yum -y install gcc-c++ zlib-devel openssl-devel readline-devel sqlite3-devel
11
+ yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
12
+ yum -y clean all
13
+
14
+ #Installing ruby
15
+ cd /tmp
16
+ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz || fail "Could not download Ruby source"
17
+ tar xzvf ruby-1.9.2-p180.tar.gz
18
+ cd ruby-1.9.2-p180
19
+ ./configure
20
+ make && make install
21
+ cd /tmp
22
+ rm -rf /tmp/ruby-1.9.2-p180
23
+ rm /tmp/ruby-1.9.2-p180.tar.gz
24
+ ln -s /usr/local/bin/ruby /usr/bin/ruby # Create a sym link for the same path
25
+ ln -s /usr/local/bin/gem /usr/bin/gem # Create a sym link for the same path
26
+
27
+ #Installing chef & Puppet
28
+ /usr/bin/gem install chef --no-ri --no-rdoc
29
+ /usr/bin/gem install puppet --no-ri --no-rdoc
30
+
31
+ #Installing vagrant keys
32
+ mkdir /home/vagrant/.ssh
33
+ chmod 700 /home/vagrant/.ssh
34
+ cd /home/vagrant/.ssh
35
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
36
+ chown -R vagrant /home/vagrant/.ssh
37
+
38
+ #Installing the virtualbox guest additions
39
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
40
+ cd /tmp
41
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
42
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
43
+ sh /mnt/VBoxLinuxAdditions.run
44
+ umount /mnt
45
+
46
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
47
+
48
+ sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
49
+ sed -i "s/^\(.*env_keep = \"\)/\1PATH /" /etc/sudoers
50
+
51
+ #poweroff -h
52
+
53
+ exit
@@ -0,0 +1,16 @@
1
+ Veewee::Session.declare({
2
+ :cpu_count => '1', :memory_size=> '384',
3
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
4
+ :os_type_id => 'RedHat',
5
+ :iso_file => "CentOS-5.8-i386-bin-DVD-1of2.iso",
6
+ :iso_src => "http://mirrors.arsc.edu/centos/5.8/isos/i386/CentOS-5.8-i386-bin-DVD-1of2.iso",
7
+ :iso_md5 => "0fdd45c43b5d8fb9e05f4255c5855f9c",
8
+ :iso_download_timeout => 10000,
9
+ :boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
10
+ :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
11
+ :ssh_login_timeout => "10000", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
12
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
13
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
14
+ :shutdown_cmd => "/sbin/halt -h -p",
15
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
16
+ })
@@ -0,0 +1,47 @@
1
+ # Kickstart file automatically generated by anaconda.
2
+
3
+ install
4
+ cdrom
5
+ lang en_US.UTF-8
6
+ langsupport --default=en_US.UTF-8 en_US.UTF-8
7
+ keyboard us
8
+ xconfig --card "VMWare" --videoram 16384 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16
9
+ network --device eth0 --bootproto dhcp
10
+ rootpw --iscrypted $1$vSG8FjAu$ekQ0grf16hS4G93HTPcco/
11
+ firewall --enabled --trust eth0 --ssh
12
+ selinux --enforcing
13
+ authconfig --enableshadow --enablemd5
14
+ timezone America/New_York
15
+ bootloader --location=mbr
16
+ # The following is the partition information you requested
17
+ # Note that any partitions you deleted are not expressed
18
+ # here so unless you clear all partitions first, this is
19
+ # not guaranteed to work
20
+ clearpart --all --drives=sda --initlabel
21
+ part /boot --fstype ext3 --size=100 --ondisk=sda
22
+ part pv.2 --size=0 --grow --ondisk=sda
23
+ volgroup VolGroup00 --pesize=32768 pv.2
24
+ logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=528 --grow --maxsize=1056
25
+ logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
26
+ reboot
27
+
28
+ %packages
29
+ #@ admin-tools
30
+ #@ text-internet
31
+ #@ dialup
32
+ #@ smb-server
33
+ #@ web-server
34
+ #@ printing
35
+ #@ server-cfg
36
+ @ core
37
+ grub
38
+ e2fsprogs
39
+ lvm2
40
+ kernel-devel
41
+ kernel-headers
42
+
43
+ %post
44
+ /usr/sbin/groupadd vagrant
45
+ /usr/sbin/useradd vagrant -g vagrant -G wheel
46
+ echo "vagrant"|passwd --stdin vagrant
47
+ echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers