-
Notifications
You must be signed in to change notification settings - Fork 776
/
Copy pathdefinition.rb
65 lines (61 loc) · 1.72 KB
/
definition.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
require 'net/http'
template_uri = 'http://distfiles.gentoo.org/releases/amd64/autobuilds/latest-install-amd64-minimal.txt'
template_build = Net::HTTP.get_response(URI.parse(template_uri)).body
template_build = /^(([^#].*)\/(.*))/.match(template_build)
Veewee::Definition.declare({
:cpu_count => 2,
:memory_size => '1024',
# set these if you would like the exported box
# to be different from the settings during build
:export_cpu_count => 1,
:export_memory_size => '384',
:disk_size => '20280',
:disk_format => 'VDI',
:hostiocache => 'off',
:os_type_id => 'Gentoo_64',
:iso_file => template_build[3],
:iso_src => "http://distfiles.gentoo.org/releases/amd64/autobuilds/#{template_build[1]}",
:iso_download_timeout => 1000,
:boot_wait => "10",
:boot_cmd_sequence => [
'<Wait>' * 2,
'gentoo-nofb<Enter>',
'<Wait>' * 30,
'<Enter>',
'<Wait>' * 20,
'<Wait><Wait>ifconfig -a<Enter>',
'passwd<Enter><Wait><Wait>',
'vagrant<Enter><Wait>',
'vagrant<Enter><Wait>',
'/etc/init.d/sshd start<Enter>'
],
:kickstart_port => '7122',
:kickstart_timeout => 10000,
:kickstart_file => '',
:ssh_login_timeout => '10000',
:ssh_user => 'root',
:ssh_password => 'vagrant',
:ssh_key => '',
:ssh_host_port => '7222',
:ssh_guest_port => '22',
:sudo_cmd => "cat '%f'|su -",
:shutdown_cmd => 'shutdown -hP now',
:postinstall_files => [
'settings.sh',
'base.sh',
'kernel.sh',
'virtualbox.sh',
'vagrant.sh',
'ruby.sh',
'chef.sh',
'puppet.sh',
'cron.sh',
'syslog.sh',
'nfs.sh',
'grub.sh',
'cleanup.sh',
'zerodisk.sh',
'reboot.sh'
],
:postinstall_timeout => 10000
})