veewee 0.1.29 → 0.2.0
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.
- data/Gemfile.lock +23 -29
- data/lib/veewee/session.rb +10 -7
- data/lib/veewee/ssh.rb +70 -42
- data/lib/veewee/version.rb +1 -1
- data/templates/CentOS-4.8-i386/postinstall.sh +2 -0
- data/templates/CentOS-5.6-i386-netboot/postinstall.sh +3 -1
- data/templates/CentOS-5.6-i386/postinstall.sh +3 -1
- data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +2 -0
- data/templates/CentOS-6.0-i386-netboot/definition.rb +16 -0
- data/templates/CentOS-6.0-i386-netboot/ks.cfg +52 -0
- data/templates/CentOS-6.0-i386-netboot/postinstall.sh +30 -0
- data/templates/CentOS-6.0-i386/definition.rb +17 -0
- data/templates/CentOS-6.0-i386/ks.cfg +47 -0
- data/templates/CentOS-6.0-i386/postinstall.sh +48 -0
- data/templates/CentOS-6.0-x86_64-netboot/definition.rb +16 -0
- data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +52 -0
- data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +30 -0
- data/templates/CentOS-6.0-x86_64/definition.rb +17 -0
- data/templates/CentOS-6.0-x86_64/ks.cfg +47 -0
- data/templates/CentOS-6.0-x86_64/postinstall.sh +48 -0
- data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +2 -0
- data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +2 -0
- data/templates/Debian-6.0.2-amd64-netboot/postinstall.sh +2 -0
- data/templates/Debian-6.0.2-i386-netboot/postinstall.sh +2 -0
- data/templates/Fedora-14-amd64-netboot/postinstall.sh +2 -0
- data/templates/Fedora-14-amd64/postinstall.sh +2 -0
- data/templates/Fedora-14-i386-netboot/postinstall.sh +2 -0
- data/templates/Fedora-14-i386/postinstall.sh +2 -0
- data/templates/Fedora-15-i386-netboot/definition.rb +17 -0
- data/templates/Fedora-15-i386-netboot/ks.cfg +82 -0
- data/templates/Fedora-15-i386-netboot/postinstall.sh +18 -0
- data/templates/Fedora-15-i386/definition.rb +17 -0
- data/templates/Fedora-15-i386/ks.cfg +64 -0
- data/templates/Fedora-15-i386/postinstall.sh +33 -0
- data/templates/archlinux-i386/aif.cfg +33 -0
- data/templates/archlinux-i386/definition.rb +29 -0
- data/templates/archlinux-i386/postinstall.sh +95 -0
- data/templates/archlinux-x86_64/aif.cfg +33 -0
- data/templates/{archlinux-64-aif-experimental → archlinux-x86_64}/definition.rb +7 -7
- data/templates/archlinux-x86_64/postinstall.sh +95 -0
- data/templates/freebsd-8.2-experimental/postinstall.sh +3 -1
- data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +2 -0
- data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +2 -0
- data/templates/gentoo-latest-i386-experimental/postinstall.sh +2 -0
- data/templates/openindiana-148-ai-x86/postinstall.sh +2 -0
- data/templates/opensuse-11.4-i386-experimental/postinstall.sh +1 -0
- data/templates/solaris-11-express-i386/postinstall.sh +2 -0
- data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.04.2-server-amd64-alt/definition.rb +57 -0
- data/templates/ubuntu-10.04.2-server-amd64-alt/postinstall.sh +249 -0
- data/templates/ubuntu-10.04.2-server-amd64-alt/preseed.cfg +124 -0
- data/templates/ubuntu-10.04.2-server-amd64/definition.rb +56 -23
- data/templates/ubuntu-10.04.2-server-amd64/postinstall.sh +4 -2
- data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.04.2-server-i386/postinstall.sh +3 -1
- data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.10-server-amd64/postinstall.sh +3 -1
- data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.10-server-i386/postinstall.sh +4 -2
- data/templates/ubuntu-11.04-server-amd64/postinstall.sh +4 -2
- data/templates/ubuntu-11.04-server-i386/postinstall.sh +4 -2
- data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +2 -0
- data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +3 -1
- data/validation/features/steps/ssh_steps.rb +22 -8
- data/veewee.gemspec +2 -2
- metadata +40 -21
- data/templates/archlinux-64-aif-experimental/postinstall.sh +0 -6
- data/templates/archlinux-64-experimental/autorun0 +0 -6
- data/templates/archlinux-64-experimental/definition.rb +0 -21
- data/templates/archlinux-64-experimental/postinstall.sh +0 -190
- data/templates/archlinux-i686/autorun0 +0 -6
- data/templates/archlinux-i686/definition.rb +0 -21
- data/templates/archlinux-i686/postinstall.sh +0 -191
data/Gemfile.lock
CHANGED
|
@@ -1,48 +1,44 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
veewee (0.
|
|
5
|
-
cucumber (
|
|
4
|
+
veewee (0.2.0)
|
|
5
|
+
cucumber (~> 1.0.2)
|
|
6
6
|
highline (~> 1.6.1)
|
|
7
7
|
net-ssh (~> 2.1.0)
|
|
8
8
|
popen4 (~> 0.1.2)
|
|
9
9
|
progressbar
|
|
10
10
|
rspec (~> 2.5.0)
|
|
11
11
|
thor (~> 0.14.6)
|
|
12
|
-
vagrant (~> 0.
|
|
12
|
+
vagrant (~> 0.8.0)
|
|
13
13
|
|
|
14
14
|
GEM
|
|
15
15
|
remote: http://rubygems.org/
|
|
16
16
|
specs:
|
|
17
17
|
Platform (0.4.0)
|
|
18
|
-
abstract (1.0.0)
|
|
19
18
|
archive-tar-minitar (0.5.2)
|
|
20
|
-
builder (
|
|
21
|
-
cucumber (0.
|
|
22
|
-
builder (
|
|
23
|
-
diff-lcs (
|
|
24
|
-
gherkin (~> 2.
|
|
25
|
-
|
|
26
|
-
term-ansicolor (
|
|
19
|
+
builder (3.0.0)
|
|
20
|
+
cucumber (1.0.2)
|
|
21
|
+
builder (>= 2.1.2)
|
|
22
|
+
diff-lcs (>= 1.1.2)
|
|
23
|
+
gherkin (~> 2.4.5)
|
|
24
|
+
json (>= 1.4.6)
|
|
25
|
+
term-ansicolor (>= 1.0.5)
|
|
27
26
|
diff-lcs (1.1.2)
|
|
28
|
-
erubis (2.
|
|
29
|
-
abstract (>= 1.0.0)
|
|
27
|
+
erubis (2.7.0)
|
|
30
28
|
ffi (1.0.9)
|
|
31
|
-
gherkin (2.
|
|
32
|
-
|
|
29
|
+
gherkin (2.4.5)
|
|
30
|
+
json (>= 1.4.6)
|
|
33
31
|
highline (1.6.2)
|
|
34
32
|
i18n (0.5.0)
|
|
35
|
-
json (1.5.
|
|
36
|
-
json_pure (1.4.6)
|
|
37
|
-
mario (0.0.6)
|
|
33
|
+
json (1.5.3)
|
|
38
34
|
net-scp (1.0.4)
|
|
39
35
|
net-ssh (>= 1.99.1)
|
|
40
36
|
net-ssh (2.1.4)
|
|
41
|
-
open4 (1.0
|
|
37
|
+
open4 (1.1.0)
|
|
42
38
|
popen4 (0.1.2)
|
|
43
39
|
Platform (>= 0.4.0)
|
|
44
40
|
open4 (>= 0.4.0)
|
|
45
|
-
progressbar (0.9.
|
|
41
|
+
progressbar (0.9.1)
|
|
46
42
|
rspec (2.5.0)
|
|
47
43
|
rspec-core (~> 2.5.0)
|
|
48
44
|
rspec-expectations (~> 2.5.0)
|
|
@@ -51,21 +47,19 @@ GEM
|
|
|
51
47
|
rspec-expectations (2.5.0)
|
|
52
48
|
diff-lcs (~> 1.1.2)
|
|
53
49
|
rspec-mocks (2.5.0)
|
|
54
|
-
term-ansicolor (1.0.
|
|
50
|
+
term-ansicolor (1.0.6)
|
|
55
51
|
thor (0.14.6)
|
|
56
|
-
|
|
57
|
-
vagrant (0.7.5)
|
|
52
|
+
vagrant (0.8.1)
|
|
58
53
|
archive-tar-minitar (= 0.5.2)
|
|
59
|
-
erubis (~> 2.
|
|
54
|
+
erubis (~> 2.7.0)
|
|
60
55
|
i18n (~> 0.5.0)
|
|
61
56
|
json (~> 1.5.1)
|
|
62
|
-
mario (~> 0.0.6)
|
|
63
57
|
net-scp (~> 1.0.4)
|
|
64
|
-
net-ssh (~> 2.1.
|
|
58
|
+
net-ssh (~> 2.1.4)
|
|
65
59
|
thor (~> 0.14.6)
|
|
66
|
-
virtualbox (~> 0.
|
|
67
|
-
virtualbox (0.
|
|
68
|
-
ffi (~> 1.0)
|
|
60
|
+
virtualbox (~> 0.9.0)
|
|
61
|
+
virtualbox (0.9.0)
|
|
62
|
+
ffi (~> 1.0.9)
|
|
69
63
|
|
|
70
64
|
PLATFORMS
|
|
71
65
|
ruby
|
data/lib/veewee/session.rb
CHANGED
|
@@ -6,6 +6,9 @@ require 'open-uri'
|
|
|
6
6
|
require 'progressbar'
|
|
7
7
|
require 'highline/import'
|
|
8
8
|
require 'tempfile'
|
|
9
|
+
require 'virtualbox'
|
|
10
|
+
require 'virtualbox/abstract_model'
|
|
11
|
+
require 'virtualbox/ext/byte_normalizer'
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
module Veewee
|
|
@@ -69,7 +72,7 @@ module Veewee
|
|
|
69
72
|
FileUtils.mkdir(File.join(@definition_dir,boxname))
|
|
70
73
|
end
|
|
71
74
|
FileUtils.cp_r(File.join(@template_dir,template_name,'.'),File.join(@definition_dir,boxname))
|
|
72
|
-
puts "The basebox '#{boxname}' has been
|
|
75
|
+
puts "The basebox '#{boxname}' has been successfully created from the template ''#{template_name}'"
|
|
73
76
|
puts "You can now edit the definition files stored in definitions/#{boxname}"
|
|
74
77
|
puts "or build the box with:"
|
|
75
78
|
if (options["format"]=='vagrant')
|
|
@@ -346,7 +349,7 @@ module Veewee
|
|
|
346
349
|
begin
|
|
347
350
|
Veewee::Ssh.transfer_file("localhost",filename,File.basename(filename),ssh_options)
|
|
348
351
|
rescue RuntimeError
|
|
349
|
-
puts "error
|
|
352
|
+
puts "error transferring file, possible not enough permissions to write?"
|
|
350
353
|
exit
|
|
351
354
|
end
|
|
352
355
|
command=@definition[:sudo_cmd]
|
|
@@ -362,11 +365,11 @@ module Veewee
|
|
|
362
365
|
|
|
363
366
|
end
|
|
364
367
|
|
|
365
|
-
puts "#{boxname} was
|
|
368
|
+
puts "#{boxname} was built successfully. "
|
|
366
369
|
puts ""
|
|
367
370
|
puts "Now you can: "
|
|
368
|
-
puts "- verify your box by running
|
|
369
|
-
puts "- export your vm to a .box
|
|
371
|
+
puts "- verify your box by running : vagrant basebox validate #{boxname}"
|
|
372
|
+
puts "- export your vm to a .box file by running : vagrant basebox export #{boxname}"
|
|
370
373
|
|
|
371
374
|
end
|
|
372
375
|
|
|
@@ -889,11 +892,11 @@ module Veewee
|
|
|
889
892
|
|
|
890
893
|
#Need to look it up again because if it was an initial load
|
|
891
894
|
vm=VirtualBox::VM.find(boxname)
|
|
892
|
-
puts "Step [#{current_step_nr}] was
|
|
895
|
+
puts "Step [#{current_step_nr}] was successfully - saving state"
|
|
893
896
|
vm.save_state
|
|
894
897
|
sleep 2 #waiting for it to be ok
|
|
895
898
|
#puts "about to snapshot #{vm}"
|
|
896
|
-
#take snapshot after
|
|
899
|
+
#take snapshot after successful execution
|
|
897
900
|
vm.take_snapshot(step_name,"snapshot taken by veewee")
|
|
898
901
|
sleep 2 #waiting for it to be started again
|
|
899
902
|
vm.start
|
data/lib/veewee/ssh.rb
CHANGED
|
@@ -13,14 +13,26 @@ module Veewee
|
|
|
13
13
|
begin
|
|
14
14
|
Timeout::timeout(options[:timeout]) do
|
|
15
15
|
connected=false
|
|
16
|
+
@key_auth_tried = false
|
|
17
|
+
ssh_options = { :port => options[:port] , :password => options[:password], :paranoid => false, :timeout => options[:timeout] }
|
|
16
18
|
while !connected do
|
|
17
19
|
begin
|
|
18
20
|
print "."
|
|
19
|
-
Net::SSH.start(ip, options[:user],
|
|
21
|
+
Net::SSH.start(ip, options[:user], ssh_options) do |ssh|
|
|
20
22
|
block.call(ip);
|
|
21
23
|
puts ""
|
|
22
24
|
return true
|
|
23
25
|
end
|
|
26
|
+
rescue Net::SSH::AuthenticationFailed
|
|
27
|
+
options[:keys] = File.join(File.dirname(__FILE__),'./../../validation/vagrant')
|
|
28
|
+
options.delete(:password)
|
|
29
|
+
ssh_options = options
|
|
30
|
+
if @key_auth_tried
|
|
31
|
+
raise
|
|
32
|
+
else
|
|
33
|
+
@key_auth_tried = true
|
|
34
|
+
retry
|
|
35
|
+
end
|
|
24
36
|
rescue Net::SSH::Disconnect,Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNABORTED, Errno::ECONNRESET, Errno::ENETUNREACH
|
|
25
37
|
sleep 5
|
|
26
38
|
end
|
|
@@ -89,64 +101,80 @@ module Veewee
|
|
|
89
101
|
|
|
90
102
|
puts "Executing command: #{command}"
|
|
91
103
|
|
|
92
|
-
|
|
104
|
+
@key_auth_tried = false
|
|
105
|
+
ssh_options = { :port => options[:port], :password => options[:password], :paranoid => false}
|
|
106
|
+
# ssh_options[:verbose] => :debug
|
|
107
|
+
begin
|
|
108
|
+
Net::SSH.start(host, options[:user], ssh_options) do |ssh|
|
|
93
109
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
# open a new channel and configure a minimal set of callbacks, then run
|
|
111
|
+
# the event loop until the channel finishes (closes)
|
|
112
|
+
channel = ssh.open_channel do |ch|
|
|
97
113
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
#request pty for sudo stuff and so
|
|
115
|
+
ch.request_pty do |ch, success|
|
|
116
|
+
raise "Error requesting pty" unless success
|
|
117
|
+
end
|
|
103
118
|
|
|
104
|
-
ch.exec "#{command}" do |ch, success|
|
|
105
|
-
raise "could not execute command" unless success
|
|
106
119
|
|
|
120
|
+
ch.exec "#{command}" do |ch, success|
|
|
121
|
+
raise "could not execute command" unless success
|
|
107
122
|
|
|
108
|
-
|
|
109
|
-
# "on_data" is called when the process writes something to stdout
|
|
110
|
-
ch.on_data do |c, data|
|
|
111
|
-
@stdout+=data
|
|
112
123
|
|
|
113
|
-
print data
|
|
114
124
|
|
|
115
|
-
|
|
125
|
+
# "on_data" is called when the process writes something to stdout
|
|
126
|
+
ch.on_data do |c, data|
|
|
127
|
+
@stdout+=data
|
|
128
|
+
|
|
129
|
+
print data
|
|
116
130
|
|
|
117
|
-
|
|
118
|
-
ch.on_extended_data do |c, type, data|
|
|
119
|
-
@stderr+=data
|
|
131
|
+
end
|
|
120
132
|
|
|
121
|
-
|
|
133
|
+
# "on_extended_data" is called when the process writes something to stderr
|
|
134
|
+
ch.on_extended_data do |c, type, data|
|
|
135
|
+
@stderr+=data
|
|
122
136
|
|
|
123
|
-
|
|
137
|
+
print data
|
|
124
138
|
|
|
125
|
-
#exit code
|
|
126
|
-
#http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a806b0f5dae4e1e2
|
|
127
|
-
channel.on_request("exit-status") do |ch, data|
|
|
128
|
-
exit_code = data.read_long
|
|
129
|
-
@status=exit_code
|
|
130
|
-
if exit_code > 0
|
|
131
|
-
puts "ERROR: exit code #{exit_code}"
|
|
132
|
-
else
|
|
133
|
-
#puts "Successfully executed"
|
|
134
139
|
end
|
|
135
|
-
end
|
|
136
140
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
#exit code
|
|
142
|
+
#http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a806b0f5dae4e1e2
|
|
143
|
+
channel.on_request("exit-status") do |ch, data|
|
|
144
|
+
exit_code = data.read_long
|
|
145
|
+
@status=exit_code
|
|
146
|
+
if exit_code > 0
|
|
147
|
+
puts "ERROR: exit code #{exit_code}"
|
|
148
|
+
else
|
|
149
|
+
#puts "Successfully executed"
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
channel.on_request("exit-signal") do |ch, data|
|
|
154
|
+
puts "SIGNAL: #{data.read_long}"
|
|
155
|
+
end
|
|
140
156
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
157
|
+
ch.on_close {
|
|
158
|
+
#puts "done!"
|
|
159
|
+
}
|
|
160
|
+
#status=ch.exec "echo $?"
|
|
161
|
+
end
|
|
145
162
|
end
|
|
163
|
+
channel.wait
|
|
146
164
|
end
|
|
147
|
-
|
|
165
|
+
rescue Net::SSH::AuthenticationFailed
|
|
166
|
+
ssh_options[:keys] = Array.new([File.join(File.dirname(__FILE__),'./../../validation/vagrant')])
|
|
167
|
+
ssh_options.delete(:password)
|
|
168
|
+
ssh_options[:auth_methods] = ['publickey']
|
|
169
|
+
if @key_auth_tried
|
|
170
|
+
raise
|
|
171
|
+
else
|
|
172
|
+
@key_auth_tried = true
|
|
173
|
+
retry
|
|
148
174
|
end
|
|
149
|
-
|
|
175
|
+
rescue Net::SSH::Disconnect, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNABORTED, Errno::ECONNRESET, Errno::ENETUNREACH
|
|
176
|
+
sleep 1
|
|
177
|
+
end
|
|
150
178
|
|
|
151
179
|
if (@status.to_s != options[:exitcode] )
|
|
152
180
|
if (options[:exitcode]=="*")
|
data/lib/veewee/version.rb
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
|
|
2
2
|
#kernel source is needed for vbox additions
|
|
3
3
|
|
|
4
|
+
date > /etc/vagrant_box_build_time
|
|
5
|
+
|
|
4
6
|
yum -y install gcc bzip2 make kernel-devel-`uname -r`
|
|
5
7
|
|
|
6
8
|
#yum -y update
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
|
|
2
2
|
#kernel source is needed for vbox additions
|
|
3
3
|
|
|
4
|
+
date > /etc/vagrant_box_build_time
|
|
5
|
+
|
|
4
6
|
yum -y install gcc bzip2 make kernel-devel-`uname -r`
|
|
5
7
|
|
|
6
8
|
#yum -y update
|
|
@@ -47,4 +49,4 @@ sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
|
|
|
47
49
|
|
|
48
50
|
#poweroff -h
|
|
49
51
|
|
|
50
|
-
exit
|
|
52
|
+
exit
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
|
|
2
2
|
#kernel source is needed for vbox additions
|
|
3
3
|
|
|
4
|
+
date > /etc/vagrant_box_build_time
|
|
5
|
+
|
|
4
6
|
yum -y install gcc bzip2 make kernel-devel-`uname -r`
|
|
5
7
|
|
|
6
8
|
#yum -y update
|
|
@@ -45,4 +47,4 @@ sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
|
|
|
45
47
|
|
|
46
48
|
#poweroff -h
|
|
47
49
|
|
|
48
|
-
exit
|
|
50
|
+
exit
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Veewee::Session.declare({
|
|
2
|
+
:cpu_count => '1', :memory_size=> '392',
|
|
3
|
+
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
|
|
4
|
+
:os_type_id => 'RedHat',
|
|
5
|
+
:iso_file => "CentOS-6.0-i386-netinstall.iso",
|
|
6
|
+
:iso_src => "http://be.mirror.eurid.eu/centos/6.0/isos/i386/CentOS-6.0-i386-netinstall.iso",
|
|
7
|
+
:iso_md5 => "65731c29c49630dea6cde103d02ccffb",
|
|
8
|
+
:iso_download_timeout => 1000,
|
|
9
|
+
:boot_wait => "15", :boot_cmd_sequence => [ '<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
|
|
10
|
+
:kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
|
|
11
|
+
:ssh_login_timeout => "100", :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,52 @@
|
|
|
1
|
+
install
|
|
2
|
+
url --url=http://be.mirror.eurid.eu/centos/6.0/os/i386/
|
|
3
|
+
lang en_US.UTF-8
|
|
4
|
+
keyboard us
|
|
5
|
+
network --bootproto dhcp
|
|
6
|
+
rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
|
|
7
|
+
firewall --enabled --trust eth0 --ssh
|
|
8
|
+
authconfig --enableshadow --enablemd5
|
|
9
|
+
selinux --disabled
|
|
10
|
+
timezone Europe/Brussels
|
|
11
|
+
bootloader --location=mbr
|
|
12
|
+
|
|
13
|
+
text
|
|
14
|
+
skipx
|
|
15
|
+
zerombr
|
|
16
|
+
|
|
17
|
+
clearpart --all --initlabel
|
|
18
|
+
autopart
|
|
19
|
+
|
|
20
|
+
auth --useshadow --enablemd5
|
|
21
|
+
firstboot --disabled
|
|
22
|
+
reboot
|
|
23
|
+
|
|
24
|
+
repo --name=epel --baseurl=http://download.fedora.redhat.com/pub/epel/6/i386/ --includepkgs='ruby-augeas,ruby-shadow'
|
|
25
|
+
repo --name=puppetlabs --baseurl=http://stahnma.fedorapeople.org/puppetlabs/6/i386 --includepkgs='puppet,facter'
|
|
26
|
+
|
|
27
|
+
%packages
|
|
28
|
+
@ core
|
|
29
|
+
ruby
|
|
30
|
+
ruby-devel
|
|
31
|
+
rubygems
|
|
32
|
+
kernel-devel
|
|
33
|
+
gcc
|
|
34
|
+
gcc-c++
|
|
35
|
+
bzip2
|
|
36
|
+
make
|
|
37
|
+
zlib-devel
|
|
38
|
+
openssl-devel
|
|
39
|
+
readline-devel
|
|
40
|
+
sqlite-devel
|
|
41
|
+
puppet
|
|
42
|
+
facter
|
|
43
|
+
|
|
44
|
+
-ipw2100-firmware
|
|
45
|
+
-ipw2200-firmware
|
|
46
|
+
-ivtv-firmware
|
|
47
|
+
|
|
48
|
+
%post
|
|
49
|
+
/usr/sbin/groupadd vagrant
|
|
50
|
+
/usr/sbin/useradd vagrant -g vagrant -G wheel
|
|
51
|
+
echo "vagrant"|passwd --stdin vagrant
|
|
52
|
+
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
|
|
2
|
+
|
|
3
|
+
date > /etc/vagrant_box_build_time
|
|
4
|
+
|
|
5
|
+
yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
|
|
6
|
+
yum -y clean all
|
|
7
|
+
|
|
8
|
+
gem install --no-ri --no-rdoc chef
|
|
9
|
+
|
|
10
|
+
# Installing vagrant keys
|
|
11
|
+
mkdir /home/vagrant/.ssh
|
|
12
|
+
chmod 700 /home/vagrant/.ssh
|
|
13
|
+
cd /home/vagrant/.ssh
|
|
14
|
+
wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
|
|
15
|
+
chown -R vagrant /home/vagrant/.ssh
|
|
16
|
+
|
|
17
|
+
# Installing the virtualbox guest additions
|
|
18
|
+
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
|
|
19
|
+
cd /tmp
|
|
20
|
+
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
|
|
21
|
+
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
|
|
22
|
+
sh /mnt/VBoxLinuxAdditions.run
|
|
23
|
+
umount /mnt
|
|
24
|
+
rm VBoxGuestAdditions_$VBOX_VERSION.iso
|
|
25
|
+
|
|
26
|
+
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
|
|
27
|
+
|
|
28
|
+
dd if=/dev/zero of=/tmp/clean || rm /tmp/clean
|
|
29
|
+
|
|
30
|
+
exit
|