Skip to content

Commit 648535a

Browse files
committedOct 15, 2014
Merge branch 'master' of github.com:jedi4ever/veewee
2 parents 428b002 + 3baf1e9 commit 648535a

File tree

6 files changed

+219
-5
lines changed

6 files changed

+219
-5
lines changed
 

Diff for: ‎lib/veewee/provider/core/box/ssh.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def ssh(command=nil,options={})
1515

1616
if (options[:interactive]==true)
1717
unless host_ip.nil? || host_ip==""
18-
ssh_command="ssh #{ssh_commandline_options(options)} #{host_ip} #{Shellwords.escape command}"
18+
ssh_command="ssh #{ssh_commandline_options(options)} #{host_ip} #{Shellwords.escape(command) if command}"
1919

2020
fg_exec(ssh_command,options)
2121

@@ -43,10 +43,10 @@ def ssh_commandline_options(options)
4343
]
4444
if definition.ssh_key
4545
command_options << "-o IdentitiesOnly=yes"
46-
ssh_keys = ssh_key_to_a(ssh_key)
46+
ssh_keys = ssh_key_to_a(definition.ssh_key)
4747
ssh_keys.each do |ssh_keys|
4848
# Filenames of SSH keys are relative to their definition
49-
ssh_key = Pathname.new(definition.ssh_key)
49+
ssh_key = Pathname.new(ssh_keys)
5050
ssh_key = File.join(definition.path, ssh_key) if ssh_key.relative?
5151
command_options << "-i #{ssh_key}"
5252
end
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Veewee::Session.declare({
2+
:cpu_count => '1',
3+
:memory_size=> '1024',
4+
:disk_size => '10140',
5+
:disk_format => 'VDI',
6+
:hostiocache => 'off',
7+
:os_type_id => 'Ubuntu',
8+
:iso_file => "ubuntu-13.04-mini-i386.iso",
9+
:iso_src => "http://archive.ubuntu.com/ubuntu/dists/raring/main/installer-i386/current/images/netboot/mini.iso",
10+
:iso_md5 => 'a8f31cd33629c43d711d95bcb21ed9d8',
11+
:iso_download_timeout => "1000",
12+
:boot_wait => "4",
13+
:boot_cmd_sequence => [
14+
'<Esc><Esc>',
15+
'linux vga=788 noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
16+
'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
17+
'hostname=%NAME% ',
18+
'fb=false debconf/frontend=noninteractive ',
19+
'keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
20+
'initrd=initrd.gz -- quiet <Enter>'
21+
],
22+
:kickstart_port => "7122",
23+
:kickstart_timeout => "10000",
24+
:kickstart_file => "preseed.cfg",
25+
:ssh_login_timeout => "10000",
26+
:ssh_user => "vagrant",
27+
:ssh_password => "vagrant",
28+
:ssh_key => "",
29+
:ssh_host_port => "7222",
30+
:ssh_guest_port => "22",
31+
:sudo_cmd => "echo '%p'|sudo -S sh '%f'",
32+
:shutdown_cmd => "shutdown -P now",
33+
:postinstall_files => [ "postinstall.sh"],
34+
:postinstall_timeout => "10000"
35+
})
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# postinstall.sh created from Mitchell's official lucid32/64 baseboxes
2+
3+
date > /etc/vagrant_box_build_time
4+
5+
6+
# Apt-install various things necessary for Ruby, guest additions,
7+
# etc., and remove optional things to trim down the machine.
8+
apt-get -y update
9+
apt-get -y upgrade
10+
apt-get -y install linux-headers-$(uname -r) build-essential
11+
apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
12+
apt-get -y install wget curl mc p7zip-full
13+
apt-get clean
14+
15+
# Installing the virtualbox guest additions
16+
apt-get -y install dkms
17+
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
18+
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
19+
sh /mnt/VBoxLinuxAdditions.run
20+
umount /mnt
21+
22+
rm VBoxGuestAdditions_$VBOX_VERSION.iso
23+
24+
cd /tmp
25+
26+
echo progress-bar >> /home/vagrant/.curlrc
27+
chown vagrant:vagrant /home/vagrant/.curlrc
28+
29+
# Setup sudo to allow no-password sudo for "admin"
30+
groupadd -r admin
31+
usermod -a -G admin vagrant
32+
cp /etc/sudoers /etc/sudoers.orig
33+
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
34+
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
35+
36+
# Add puppet user and group
37+
#adduser --system --group --home /var/lib/puppet puppet
38+
39+
# Install NFS client
40+
apt-get -y install nfs-common
41+
42+
# Install RVM and Ruby.
43+
curl -L https://get.rvm.io | bash -s head --ruby
44+
/etc/profile.d/rvm.sh
45+
/usr/local/rvm/bin/rvm use ruby --default
46+
usermod -a -G rvm vagrant
47+
/usr/local/rvm/bin/gem update --system
48+
/usr/local/rvm/bin/gem update
49+
50+
# Installing chef & Puppet
51+
/usr/local/rvm/bin/gem install chef --no-ri --no-rdoc
52+
/usr/local/rvm/bin/gem install puppet --no-ri --no-rdoc
53+
54+
# Installing vagrant keys
55+
mkdir /home/vagrant/.ssh
56+
chmod 700 /home/vagrant/.ssh
57+
cd /home/vagrant/.ssh
58+
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
59+
chmod 600 /home/vagrant/.ssh/authorized_keys
60+
chown -R vagrant /home/vagrant/.ssh
61+
62+
# Remove items used for building, since they aren't needed anymore
63+
apt-get -y remove linux-headers-$(uname -r) build-essential
64+
apt-get -y autoremove
65+
66+
# Zero out the free space to save space in the final image:
67+
dd if=/dev/zero of=/EMPTY bs=1M
68+
rm -f /EMPTY
69+
70+
# Removing leftover leases and persistent rules
71+
echo "cleaning up dhcp leases"
72+
rm /var/lib/dhcp/*
73+
74+
# Make sure Udev doesn't block our network
75+
# http://6.ptmc.org/?p=164
76+
echo "cleaning up udev rules"
77+
rm /etc/udev/rules.d/70-persistent-net.rules
78+
mkdir /etc/udev/rules.d/70-persistent-net.rules
79+
rm -rf /dev/.udev/
80+
rm /lib/udev/rules.d/75-persistent-net-generator.rules
81+
82+
echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
83+
echo "pre-up sleep 2" >> /etc/network/interfaces
84+
exit

Diff for: ‎templates/ubuntu-13.04-minimal-i386-rvm/preseed.cfg

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
## Options to set on the command line
2+
d-i debian-installer/locale string en_US.utf8
3+
d-i console-setup/ask_detect boolean false
4+
d-i console-setup/layout string us
5+
6+
#d-i netcfg/get_hostname string dummy
7+
d-i netcfg/get_hostname string unassigned-hostname
8+
d-i netcfg/get_domain string unassigned-domain
9+
10+
# Continue without a default route
11+
# Not working , specify a dummy in the DHCP
12+
#d-i netcfg/no_default_route boolean
13+
14+
d-i time/zone string UTC
15+
d-i clock-setup/utc-auto boolean true
16+
d-i clock-setup/utc boolean true
17+
18+
d-i kbd-chooser/method select American English
19+
20+
d-i netcfg/wireless_wep string
21+
22+
d-i base-installer/kernel/override-image string linux-server
23+
#d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
24+
25+
# Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
26+
d-i debconf debconf/frontend select Noninteractive
27+
28+
d-i pkgsel/install-language-support boolean false
29+
tasksel tasksel/first multiselect standard, ubuntu-server
30+
31+
#d-i partman-auto/method string regular
32+
d-i partman-auto/method string lvm
33+
#d-i partman-auto/purge_lvm_from_device boolean true
34+
35+
d-i partman-lvm/confirm boolean true
36+
d-i partman-lvm/device_remove_lvm boolean true
37+
d-i partman-auto/choose_recipe select atomic
38+
39+
d-i partman/confirm_write_new_label boolean true
40+
d-i partman/confirm_nooverwrite boolean true
41+
d-i partman/choose_partition select finish
42+
d-i partman/confirm boolean true
43+
44+
#http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
45+
#Message: "write the changes to disk and configure lvm preseed"
46+
#http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
47+
#preseed partman-lvm/confirm_nooverwrite boolean true
48+
49+
# Write the changes to disks and configure LVM?
50+
d-i partman-lvm/confirm boolean true
51+
d-i partman-lvm/confirm_nooverwrite boolean true
52+
d-i partman-auto-lvm/guided_size string max
53+
54+
## Default user, we can get away with a recipe to change this
55+
d-i passwd/user-fullname string vagrant
56+
d-i passwd/username string vagrant
57+
d-i passwd/user-password password vagrant
58+
d-i passwd/user-password-again password vagrant
59+
d-i user-setup/encrypt-home boolean false
60+
d-i user-setup/allow-password-weak boolean true
61+
62+
## minimum is puppet and ssh and ntp
63+
# Individual additional packages to install
64+
d-i pkgsel/include string openssh-server ntp
65+
66+
# Whether to upgrade packages after debootstrap.
67+
# Allowed values: none, safe-upgrade, full-upgrade
68+
d-i pkgsel/upgrade select full-upgrade
69+
70+
d-i grub-installer/only_debian boolean true
71+
d-i grub-installer/with_other_os boolean true
72+
d-i finish-install/reboot_in_progress note
73+
74+
#For the update
75+
d-i pkgsel/update-policy select none
76+
77+
# debconf-get-selections --install
78+
#Use mirror
79+
#d-i apt-setup/use_mirror boolean true
80+
#d-i mirror/country string manual
81+
#choose-mirror-bin mirror/protocol string http
82+
#choose-mirror-bin mirror/http/hostname string 192.168.4.150
83+
#choose-mirror-bin mirror/http/directory string /ubuntu
84+
#choose-mirror-bin mirror/suite select maverick
85+
#d-i debian-installer/allow_unauthenticated string true
86+
87+
choose-mirror-bin mirror/http/proxy string
88+
89+
d-i mirror/country string manual
90+
d-i mirror/http/hostname string archive.ubuntu.com
91+
d-i mirror/http/directory string /ubuntu
92+
d-i mirror/proxy string
93+
d-i mirror/http/mirror select us.archive.ubuntu.com

Diff for: ‎templates/windows-2012-serverstandard-amd64/Autounattend.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737

3838
<UserData>
3939
<!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx -->
40-
<ProductKey>YC6KT-GKW9T-YTKYR-T4X34-R7VHC
40+
<ProductKey>
41+
<Key>YC6KT-GKW9T-YTKYR-T4X34-R7VHC</Key>
4142
<WillShowUI>Never</WillShowUI>
4243
</ProductKey>
4344

Diff for: ‎templates/windows-2012R2-serverdatacenter-amd64/Autounattend.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737

3838
<UserData>
3939
<!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx -->
40-
<ProductKey>W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
40+
<ProductKey>
41+
<Key>W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9</Key>
4142
<WillShowUI>Never</WillShowUI>
4243
</ProductKey>
4344

0 commit comments

Comments
 (0)