Permalink
Browse files

merge with master fixes: rspec gemspec + session->definition

  • Loading branch information...
2 parents 42e2eec + 4f0259d commit 78206306c272458e68309eab8c6d5bdfce22d4ad @jedi4ever committed Nov 25, 2011
View
@@ -11,8 +11,12 @@ PATH
net-ssh (~> 2.1.0)
popen4 (~> 0.1.2)
progressbar
+<<<<<<< HEAD
rspec (~> 2.5.0)
ruby-vnc (~> 1.0.0)
+=======
+ rspec (~> 2.5)
@hedgehog

hedgehog Nov 25, 2011

Contributor

This looks like an unresolved merge conflict. Below too.

+>>>>>>> master
thor (~> 0.14.6)
vagrant (~> 0.8.2)
@@ -34,6 +38,7 @@ GEM
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
erubis (2.7.0)
+<<<<<<< HEAD
excon (0.7.6)
ffi (1.0.9)
fog (1.0.0)
@@ -60,10 +65,23 @@ GEM
net-ssh (2.1.4)
nokogiri (1.5.0)
open4 (1.2.0)
+=======
+ ffi (1.0.11)
+ gherkin (2.4.21)
+ json (>= 1.4.6)
+ highline (1.6.8)
+ i18n (0.6.0)
+ json (1.5.4)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-ssh (2.1.4)
+ open4 (1.3.0)
+>>>>>>> master
popen4 (0.1.2)
Platform (>= 0.4.0)
open4 (>= 0.4.0)
progressbar (0.9.1)
+<<<<<<< HEAD
rake (0.9.2)
rspec (2.5.0)
rspec-core (~> 2.5.0)
@@ -76,6 +94,17 @@ GEM
ruby-hmac (0.4.0)
ruby-vnc (1.0.1)
term-ansicolor (1.0.6)
+=======
+ rspec (2.7.0)
+ rspec-core (~> 2.7.0)
+ rspec-expectations (~> 2.7.0)
+ rspec-mocks (~> 2.7.0)
+ rspec-core (2.7.1)
+ rspec-expectations (2.7.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.7.0)
+ term-ansicolor (1.0.7)
+>>>>>>> master
thor (0.14.6)
vagrant (0.8.7)
archive-tar-minitar (= 0.5.2)
@@ -94,5 +123,8 @@ PLATFORMS
DEPENDENCIES
bundler (>= 1.0.0)
+<<<<<<< HEAD
rake
+=======
+>>>>>>> master
veewee!
View
@@ -131,7 +131,7 @@ Put your isofile inside the 'currentdir'/iso directory or if you don't run
- Mount the ISO File :iso_file
- Boot up the machine and wait for :boot_time
- Send the keystrokes in :boot_cmd_sequence
-- Startup a webserver on :kickstart_port to wait for a request for the :kickstart_file
+- Startup a webserver on :kickstart_port to wait for a request for the :kickstart_file (don't navigate to the file in your browser or the server will stop and the installer will not be able to find your preseed)
- Wait for ssh login to work with :ssh_user , :ssh_password
- Sudo execute the :postinstall_files
View
@@ -4,12 +4,25 @@ require 'bundler/setup'
require 'veewee'
Bundler::GemHelper.install_tasks
+<<<<<<< HEAD
desc 'Default: run tests'
task :default => :test
+=======
@hedgehog

hedgehog Nov 25, 2011

Contributor

This looks like an unresolved merge conflict. Below too.

@jedi4ever

jedi4ever Nov 25, 2011

Owner

This should be fixed by subsequent commits - do you have a problem with this in a merge or so?

Could you confirm that a pull to last version, solves this?

@hedgehog

hedgehog Nov 25, 2011

Contributor

No problem, just scanning the changes. May not get to test this out for a while - the ssh expedition set me back a couple of weeks.

+#Setup some base variables to use
+veewee_dir = "."
+lib_dir = File.expand_path(File.join(veewee_dir, "lib"))
+box_dir = File.expand_path(File.join(veewee_dir, "boxes"))
+vbox_dir = File.expand_path(File.join(veewee_dir, "tmp"))
+tmp_dir = File.expand_path(File.join(veewee_dir, "tmp"))
+iso_dir = File.expand_path(File.join(veewee_dir, "iso"))
+definition_dir = File.expand_path(File.join(veewee_dir, "definitions"))
+template_dir = File.expand_path(File.join(veewee_dir, "templates"))
+>>>>>>> master
require 'rake/testtask'
Bundler::GemHelper.install_tasks
+<<<<<<< HEAD
desc 'Tests not requiring an real box'
Rake::TestTask.new do |t|
t.libs << "test"
@@ -62,4 +75,86 @@ task :iso, [:box_name] do |t,args|
puts "Error"+ex.to_s+definition.iso_src
end
end
+=======
+#Load Veewee::Session libraries
+Dir.glob(File.join(lib_dir, '**','*.rb')).each { |f| require f }
+
+#Initialize
+Veewee::Session.setenv({
+ :veewee_dir => veewee_dir,
+ :definition_dir => definition_dir,
+ :template_dir => template_dir,
+ :iso_dir => iso_dir,
+ :box_dir => box_dir,
+ :tmp_dir => tmp_dir
+})
+
+desc 'Default: list templates'
+task :default => [:templates]
+
+desc 'List templates'
+task :templates do
+ Veewee::Session.list_templates
+end
+
+desc 'Define box'
+task :define, [:boxname,:template_name] do |t,args|
+ if args.to_hash.size!=2
+ puts "needs two arguments: rake define['boxname','template_name']"
+ exit
+ end
+ Veewee::Session.define(args.boxname,args.template_name)
+end
+
+desc 'Undefine box'
+task :undefine, [:boxname] do |t,args|
+ if args.to_hash.size!=1
+ puts "needs one arguments: rake undefine[\"yourname\"]"
+ exit
+ end
+ Veewee::Session.undefine(args.boxname)
+end
+
+desc 'List Definitions'
+task :definitions do
+ Veewee::Session.list_definitions
+end
+
+desc 'Build box'
+task :build, [:boxname] do |t,args|
+ if args.to_hash.size!=1
+ puts "needs one arguments: rake build['boxname']"
+ exit
+ end
+ Veewee::Session.build(args.boxname)
+end
+
+desc 'List boxes'
+task :boxes do
+ Veewee::Session.list_boxes
+end
+
+desc 'Export box'
+task :export, [:boxname] do |t,args|
+ if args.to_hash.size!=1
+ puts "needs one arguments: rake export['boxname']"
+ exit
+ end
+ Veewee::Session.export_box(args.boxname)
+end
+
+desc 'Remove box'
+task :remove_box, [:boxname] do |t,args|
+ Veewee::Session.remove_box(args.boxname)
+end
+
+desc 'List ostypes available'
+task :list_ostypes do |t,args|
+ Veewee::Session.list_ostypes
+end
+
+desc 'Clean all unfinished builds'
+task :clean do
+ Veewee::Session.clean
+>>>>>>> master
end
@@ -1,5 +1,6 @@
# Many thanks to @draco2002
# http://dracosplace.com/veewee_and_freebsd
+#Based on https://gist.github.com/911058
Veewee::Definition.declare( {
:cpu_count => '1', :memory_size=> '768',
@@ -10,20 +11,20 @@
:iso_md5 => "548646b9d1042a162f769bc280149417",
:iso_download_timeout => "1000",
:boot_wait => "70",:boot_cmd_sequence => [
- '<KillX>',
- '<Enter>',
- 'dhclient em0<Enter>',
- 'sleep 15;echo "Lets Get the File";fetch "http://%IP%:%PORT%/pcinstall.fbg.cfg";sleep 2;',
- 'echo \'echo sshd_enable=\"YES\" >> $FSMNT/etc/rc.conf\' > /root/activate-ssh.sh ; cat /root/activate-ssh.sh<Enter>',
- 'chmod +x /root/activate-ssh.sh<Enter>',
- 'echo "Hope i got the file";/usr/PCBSD/pc-sysinstall/pc-sysinstall -c /root/pcinstall.fbg.cfg<Enter>',
- 'reboot<Enter>'
- ],
+ '<KillX>',
+ '<Enter>',
+ 'dhclient em0<Enter>',
+ 'sleep 15;echo "Lets Get the File";fetch "http://%IP%:%PORT%/pcinstall.fbg.cfg";sleep 2;',
+ 'echo \'echo sshd_enable=\"YES\" >> $FSMNT/etc/rc.conf\' > /root/activate-ssh.sh ; cat /root/activate-ssh.sh<Enter>',
+ 'chmod +x /root/activate-ssh.sh<Enter>',
+ 'echo "Hope i got the file";/usr/PCBSD/pc-sysinstall/pc-sysinstall -c /root/pcinstall.fbg.cfg<Enter>',
+ 'reboot<Enter>'
+],
:kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "pcinstall.fbg.cfg",
:ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
:ssh_host_port => "7222", :ssh_guest_port => "22",
:sudo_cmd => "cat '%f'|su -",
:shutdown_cmd => "shutdown -p now",
:postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
- }
-)
+}
+ )
@@ -0,0 +1,16 @@
+Veewee::Session.declare({
+ :cpu_count => '1', :memory_size=> '512',
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
+ :os_type_id => 'RedHat_64',
+ :iso_file => "SL-61-i386-2011-07-27-boot.iso",
+ :iso_src => "http://mirrors.200p-sf.sonic.net/scientific/6.1/i386/iso/SL-61-i386-2011-07-27-boot.iso",
+ :iso_md5 => "d3cd58e67052331c9c3648e3ecd00b13",
+ :iso_download_timeout => 1000,
+ :boot_wait => "15", :boot_cmd_sequence => [ '<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
+ :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
+ :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
+ :shutdown_cmd => "/sbin/halt -h -p",
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
+})
@@ -0,0 +1,53 @@
+install
+url --url=http://mirrors.200p-sf.sonic.net/scientific/6.1/i386/os/
+lang en_US.UTF-8
+keyboard us
+network --bootproto dhcp
+rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
+firewall --enabled --trust eth0 --ssh
+authconfig --enableshadow --enablemd5
+selinux --disabled
+timezone UTC
+bootloader --location=mbr
+
+text
+skipx
+zerombr
+
+clearpart --all --initlabel
+autopart
+
+auth --useshadow --enablemd5
+firstboot --disabled
+reboot
+
+repo --name=epel --baseurl=http://download.fedora.redhat.com/pub/epel/6/i386/ --includepkgs='ruby-augeas,ruby-shadow'
+repo --name=puppetlabs --baseurl=http://yum.puppetlabs.com/el/6/products/i386/ --includepkgs='puppet,facter'
+repo --name=puppetlabs-dependencies --baseurl=http://yum.puppetlabs.com/el/6/dependencies/i386/
+
+%packages
+@ core
+ruby
+ruby-devel
+rubygems
+kernel-devel
+gcc
+gcc-c++
+bzip2
+make
+zlib-devel
+openssl-devel
+readline-devel
+sqlite-devel
+puppet
+facter
+
+-ipw2100-firmware
+-ipw2200-firmware
+-ivtv-firmware
+
+%post
+/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
@@ -0,0 +1,30 @@
+#http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
+
+date > /etc/vagrant_box_build_time
+
+yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
+yum -y clean all
+
+gem install --no-ri --no-rdoc chef
+
+# Installing vagrant keys
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+
+# Installing the virtualbox guest additions
+VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
+cd /tmp
+wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
+sh /mnt/VBoxLinuxAdditions.run
+umount /mnt
+rm VBoxGuestAdditions_$VBOX_VERSION.iso
+
+sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
+
+dd if=/dev/zero of=/tmp/clean || rm /tmp/clean
+
+exit
@@ -0,0 +1,16 @@
+Veewee::Session.declare({
+ :cpu_count => '1', :memory_size=> '512',
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
+ :os_type_id => 'RedHat_64',
+ :iso_file => "SL-61-x86_64-2011-07-27-boot.iso",
+ :iso_src => "http://mirrors.200p-sf.sonic.net/scientific/6.1/x86_64/iso/SL-61-x86_64-2011-07-27-boot.iso",
+ :iso_md5 => "863841b65b5b42f7ad0e735bb9aa669d",
+ :iso_download_timeout => 1000,
+ :boot_wait => "15", :boot_cmd_sequence => [ '<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
+ :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
+ :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
+ :ssh_host_port => "7222", :ssh_guest_port => "22",
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
+ :shutdown_cmd => "/sbin/halt -h -p",
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
+})
Oops, something went wrong.

0 comments on commit 7820630

Please sign in to comment.