veewee 0.1.26 → 0.1.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/Gemfile.lock +1 -1
  2. data/README.md +107 -99
  3. data/lib/veewee/command.rb +2 -1
  4. data/lib/veewee/scancode.rb +21 -4
  5. data/lib/veewee/session.rb +2 -2
  6. data/lib/veewee/version.rb +1 -1
  7. data/templates/CentOS-5.6-x86_64-netboot/definition.rb +16 -0
  8. data/templates/CentOS-5.6-x86_64-netboot/ks.cfg +45 -0
  9. data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +58 -0
  10. data/templates/{Debian-6.0.1a-amd64-netboot → Debian-5.0.8-amd64-netboot}/definition.rb +3 -3
  11. data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +57 -0
  12. data/templates/{Debian-6.0.1a-amd64-netboot → Debian-5.0.8-amd64-netboot}/preseed.cfg +0 -0
  13. data/templates/Debian-5.0.8-i386-netboot/definition.rb +39 -0
  14. data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +57 -0
  15. data/templates/Debian-5.0.8-i386-netboot/preseed.cfg +312 -0
  16. data/templates/Debian-6.0.2-amd64-netboot/definition.rb +39 -0
  17. data/templates/Debian-6.0.2-amd64-netboot/postinstall.sh +68 -0
  18. data/templates/Debian-6.0.2-amd64-netboot/preseed.cfg +312 -0
  19. data/templates/{Debian-6.0.1a-i386-netboot → Debian-6.0.2-i386-netboot}/definition.rb +3 -3
  20. data/templates/{Debian-6.0.1a-i386-netboot → Debian-6.0.2-i386-netboot}/postinstall.sh +22 -2
  21. data/templates/{Debian-6.0.1a-i386-netboot → Debian-6.0.2-i386-netboot}/preseed.cfg +0 -0
  22. data/templates/archlinux-64-aif-experimental/definition.rb +29 -0
  23. data/templates/archlinux-64-aif-experimental/postinstall.sh +6 -0
  24. data/templates/archlinux-64-experimental/autorun0 +6 -0
  25. data/templates/archlinux-64-experimental/definition.rb +21 -0
  26. data/templates/archlinux-64-experimental/postinstall.sh +190 -0
  27. data/templates/archlinux-i686/definition.rb +1 -1
  28. data/templates/openindiana-148-ai-x86/auto_install/ai.dtd +58 -0
  29. data/templates/openindiana-148-ai-x86/auto_install/ai_manifest.xml +241 -0
  30. data/templates/openindiana-148-ai-x86/auto_install/configuration.dtd +44 -0
  31. data/templates/openindiana-148-ai-x86/auto_install/default.xml +121 -0
  32. data/templates/openindiana-148-ai-x86/auto_install/default.xml.orig +124 -0
  33. data/templates/openindiana-148-ai-x86/auto_install/sc_profiles/static_network.xml +105 -0
  34. data/templates/openindiana-148-ai-x86/auto_install/software.dtd +105 -0
  35. data/templates/openindiana-148-ai-x86/auto_install/target.dtd +196 -0
  36. data/templates/openindiana-148-ai-x86/default.xml +121 -0
  37. data/templates/openindiana-148-ai-x86/definition.rb +59 -0
  38. data/templates/openindiana-148-ai-x86/postinstall.sh +101 -0
  39. data/templates/solaris-11-express-i386/definition.rb +6 -11
  40. data/templates/solaris-11-express-i386/postinstall.sh +2 -2
  41. data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +1 -0
  42. data/templates/ubuntu-10.04.2-server-amd64/postinstall.sh +1 -0
  43. data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +1 -0
  44. data/templates/ubuntu-10.04.2-server-i386/postinstall.sh +1 -0
  45. data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +1 -0
  46. data/templates/ubuntu-10.10-server-amd64/postinstall.sh +1 -0
  47. data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +1 -0
  48. data/templates/ubuntu-10.10-server-i386/postinstall.sh +1 -0
  49. data/templates/ubuntu-11.04-server-amd64/postinstall.sh +1 -0
  50. data/templates/ubuntu-11.04-server-i386/postinstall.sh +1 -0
  51. data/templates/ubuntu-8.04.4-server-amd64/definition.rb +25 -0
  52. data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +66 -0
  53. data/templates/ubuntu-8.04.4-server-amd64/preseed.cfg +88 -0
  54. data/templates/ubuntu-8.04.4-server-i386/definition.rb +25 -0
  55. data/templates/{Debian-6.0.1a-amd64-netboot → ubuntu-8.04.4-server-i386}/postinstall.sh +7 -10
  56. data/templates/ubuntu-8.04.4-server-i386/preseed.cfg +87 -0
  57. data/templates/{windows-2008R2-amd64-experimental → windows-2008R2-amd64}/Autounattend.xml +1 -1
  58. data/templates/windows-2008R2-amd64/README.md +68 -0
  59. data/templates/{windows-2008R2-amd64-experimental → windows-2008R2-amd64}/cygwin-setup.exe +0 -0
  60. data/templates/{windows-2008R2-amd64-experimental → windows-2008R2-amd64}/definition.rb +2 -3
  61. data/templates/{windows-2008R2-amd64-experimental/cygwin-sshd.bat → windows-2008R2-amd64/install-cygwin-sshd.bat} +0 -0
  62. data/templates/{windows-2008R2-amd64-experimental → windows-2008R2-amd64}/install-winrm.bat +0 -0
  63. data/templates/windows-2008R2-amd64/oracle-cert.cer +0 -0
  64. data/templates/windows-2008R2-amd64/postinstall.sh +122 -0
  65. data/templates/{windows-2008R2-amd64-experimental → windows-2008R2-amd64}/winrm.rb +0 -0
  66. metadata +50 -19
  67. data/templates/windows-2008R2-amd64-experimental/README.md +0 -33
  68. data/templates/windows-2008R2-amd64-experimental/note-virtualbox-additions.txt +0 -23
  69. data/templates/windows-2008R2-amd64-experimental/postinstall.sh +0 -48
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- veewee (0.1.26)
4
+ veewee (0.1.27)
5
5
  cucumber (= 0.8.5)
6
6
  highline (~> 1.6.1)
7
7
  net-ssh (~> 2.1.0)
data/README.md CHANGED
@@ -5,114 +5,126 @@ The first step is to download an existing 'base box'. I believe this scares a lo
5
5
  Veewee tries to automate this and to share the knowledge and sources you need to create a basebox. Instead of creating custom ISO's from your favorite distribution, it leverages the 'keyboardputscancode' command of Virtualbox so send the actual 'boot prompt' keysequence to boot an existing iso.
6
6
 
7
7
  Before we can actually build the boxes, we need to take care of the minimal things to install:
8
+
8
9
  - Have Virtualbox 4.x installed -> download it from http://download.virtualbox.org/virtualbox/
9
10
 
10
11
 
11
12
  People have reported good experiences, why don't you give it a try?
12
13
 
13
- ## Installation:
14
+ ## Installation:
14
15
  __as a gem__
15
- <pre>
16
- $ gem install veewee
17
- </pre>
16
+
17
+ $ gem install veewee
18
18
 
19
19
  __from source__
20
- <pre>
21
- $ git clone https://github.com/jedi4ever/veewee.git
22
- $ cd veewee
23
- $ gem install bundler
24
- $ bundle install
20
+
21
+ $ git clone https://github.com/jedi4ever/veewee.git
22
+ $ cd veewee
23
+ $ gem install bundler
24
+ $ bundle install
25
25
 
26
26
  If you don't use rvm, be sure to execute vagrant through bundle exec
27
- $ alias vagrant="bundle exec vagrant"
28
- </pre>
27
+
28
+ $ alias vagrant="bundle exec vagrant"
29
29
 
30
30
 
31
31
  ## List all templates
32
- <pre>
33
- $ vagrant basebox templates
34
- The following templates are available:
35
- The following templates are available:
36
- vagrant basebox define '<boxname>' 'Archlinux-latest'
37
- vagrant basebox define '<boxname>' 'CentOS-4.8-i386'
38
- vagrant basebox define '<boxname>' 'CentOS-5.5-i386'
39
- vagrant basebox define '<boxname>' 'CentOS-5.5-i386-netboot'
40
- vagrant basebox define '<boxname>' 'Debian-6.0-amd64-netboot'
41
- vagrant basebox define '<boxname>' 'Debian-6.0-i386-netboot'
42
- vagrant basebox define '<boxname>' 'Fedora-14-amd64'
43
- vagrant basebox define '<boxname>' 'Fedora-14-amd64-netboot'
44
- vagrant basebox define '<boxname>' 'Fedora-14-i386'
45
- vagrant basebox define '<boxname>' 'Fedora-14-i386-netboot'
46
- vagrant basebox define '<boxname>' 'freebsd-8.2-experimental'
47
- vagrant basebox define '<boxname>' 'freebsd-8.2-pcbsd-i386'
48
- vagrant basebox define '<boxname>' 'freebsd-8.2-pcbsd-i386-netboot'
49
- vagrant basebox define '<boxname>' 'solaris-11-express-i386'
50
- vagrant basebox define '<boxname>' 'Sysrescuecd-2.0.0-experimental'
51
- vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-amd64'
52
- vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-i386'
53
- vagrant basebox define '<boxname>' 'ubuntu-10.10-server-amd64'
54
- vagrant basebox define '<boxname>' 'ubuntu-10.10-server-amd64-netboot'
55
- vagrant basebox define '<boxname>' 'ubuntu-10.10-server-i386'
56
- vagrant basebox define '<boxname>' 'ubuntu-10.10-server-i386-netboot'
57
-
58
-
59
- </pre>
60
- ## Define a new box
32
+
33
+ $ vagrant basebox templates
34
+ The following templates are available:
35
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-i386-netboot'
36
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-amd64-netboot'
37
+ vagrant basebox define '<boxname>' 'solaris-11-express-i386'
38
+ vagrant basebox define '<boxname>' 'freebsd-8.2-pcbsd-i386-netboot'
39
+ vagrant basebox define '<boxname>' 'Fedora-14-amd64-netboot'
40
+ vagrant basebox define '<boxname>' 'ubuntu-11.04-server-amd64'
41
+ vagrant basebox define '<boxname>' 'freebsd-8.2-experimental'
42
+ vagrant basebox define '<boxname>' 'archlinux-i686'
43
+ vagrant basebox define '<boxname>' 'CentOS-5.6-i386-netboot'
44
+ vagrant basebox define '<boxname>' 'openindiana-148-ai-x86'
45
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-i386'
46
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-i386'
47
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-amd64-netboot'
48
+ vagrant basebox define '<boxname>' 'Sysrescuecd-2.0.0-experimental'
49
+ vagrant basebox define '<boxname>' 'Debian-6.0.1a-amd64-netboot'
50
+ vagrant basebox define '<boxname>' 'freebsd-8.2-pcbsd-i386'
51
+ vagrant basebox define '<boxname>' 'Fedora-14-i386'
52
+ vagrant basebox define '<boxname>' 'Fedora-14-amd64'
53
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-i386-netboot'
54
+ vagrant basebox define '<boxname>' 'opensuse-11.4-i386-experimental'
55
+ vagrant basebox define '<boxname>' 'CentOS-4.8-i386'
56
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-amd64'
57
+ vagrant basebox define '<boxname>' 'ubuntu-8.04.4-server-amd64'
58
+ vagrant basebox define '<boxname>' 'gentoo-latest-i386-experimental'
59
+ vagrant basebox define '<boxname>' 'ubuntu-8.04.4-server-i386'
60
+ vagrant basebox define '<boxname>' 'windows-2008R2-amd64'
61
+ vagrant basebox define '<boxname>' 'Fedora-14-i386-netboot'
62
+ vagrant basebox define '<boxname>' 'archlinux-64-experimental'
63
+ vagrant basebox define '<boxname>' 'Debian-6.0.1a-i386-netboot'
64
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-amd64'
65
+ vagrant basebox define '<boxname>' 'archlinux-64-aif-experimental'
66
+ vagrant basebox define '<boxname>' 'ubuntu-11.04-server-i386'
67
+ vagrant basebox define '<boxname>' 'CentOS-5.6-i386'
68
+
69
+
70
+ ## Define a new box
61
71
  Let's define a Ubuntu 10.10 server i386 basebox called myunbuntubox
62
72
  this is essentially making a copy based on the templates provided above.
63
- <pre>$ vagrant basebox define 'myubuntubox' 'ubuntu-10.10-server-i386'</pre>
64
- template successfully copied
73
+
74
+ $ vagrant basebox define 'myubuntubox' 'ubuntu-10.10-server-i386'
75
+ The basebox 'myubuntubox' has been succesfully created from the template ''ubuntu-10.10-server-i386'
76
+ You can now edit the definition files stored in definitions/myubuntubox
77
+ or build the box with:
78
+ vagrant basebox build 'myubuntubox'
65
79
 
66
80
  -> This copies over the templates/ubuntu-10.10-server-i386 to definition/myubuntubox
67
81
 
68
- <pre>$ ls definitions/myubuntubox
69
- definition.rb postinstall.sh postinstall2.sh preseed.cfg
70
- </pre>
82
+ $ ls definitions/myubuntubox
83
+ definition.rb postinstall.sh postinstall2.sh preseed.cfg
71
84
 
72
85
  ## Optionally modify the definition.rb , postinstall.sh or preseed.cfg
73
86
 
74
- <pre>
75
- Veewee::Session.declare( {
76
- :cpu_count => '1', :memory_size=> '256',
77
- :disk_size => '10140', :disk_format => 'VDI',
78
- :os_type_id => 'Ubuntu',
79
- :iso_file => "ubuntu-10.10-server-i386.iso",
80
- :iso_src => "http://releases.ubuntu.com/maverick/ubuntu-10.10-server-i386.iso",
81
- :iso_md5 => "ce1cee108de737d7492e37069eed538e",
82
- :iso_download_timeout => "1000",
83
- :boot_wait => "10",
84
- :boot_cmd_sequence => [
85
- '<Esc><Esc><Enter>',
86
- '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
87
- 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
88
- 'hostname=%NAME% ',
89
- 'fb=false debconf/frontend=noninteractive ',
90
- 'console-setup/ask_detect=false console-setup/modelcode=pc105 console-setup/layoutcode=us ',
91
- 'initrd=/install/initrd.gz -- <Enter>'
92
- ],
93
- :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
94
- :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
95
- :ssh_host_port => "2222", :ssh_guest_port => "22",
96
- :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
97
- :shutdown_cmd => "shutdown -H",
98
- :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
99
- }
100
- )
101
- </pre>
87
+ Veewee::Session.declare( {
88
+ :cpu_count => '1', :memory_size=> '256',
89
+ :disk_size => '10140', :disk_format => 'VDI',
90
+ :os_type_id => 'Ubuntu',
91
+ :iso_file => "ubuntu-10.10-server-i386.iso",
92
+ :iso_src => "http://releases.ubuntu.com/maverick/ubuntu-10.10-server-i386.iso",
93
+ :iso_md5 => "ce1cee108de737d7492e37069eed538e",
94
+ :iso_download_timeout => "1000",
95
+ :boot_wait => "10",
96
+ :boot_cmd_sequence => [
97
+ '<Esc><Esc><Enter>',
98
+ '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
99
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
100
+ 'hostname=%NAME% ',
101
+ 'fb=false debconf/frontend=noninteractive ',
102
+ 'console-setup/ask_detect=false console-setup/modelcode=pc105 console-setup/layoutcode=us ',
103
+ 'initrd=/install/initrd.gz -- <Enter>'
104
+ ],
105
+ :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
106
+ :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
107
+ :ssh_host_port => "2222", :ssh_guest_port => "22",
108
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
109
+ :shutdown_cmd => "shutdown -H",
110
+ :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
111
+ }
112
+ )
102
113
 
103
114
  If you need to change values in the templates, be sure to run the rake undefine, the rake define again to copy the changes across.
104
115
 
105
116
  ## Getting the cdrom file in place
106
117
  Put your isofile inside the 'currentdir'/iso directory or if you don't run
107
- <pre>$ vagrant basebox build 'myubuntubox'</pre>
118
+
119
+ $ vagrant basebox build 'myubuntubox'
108
120
 
109
121
  - the build assumes your iso files are in 'currentdir'/iso
110
122
  - if it can not find it will suggest to download the iso for you
111
123
  - use '--force' to overwrite an existing install
112
124
 
113
125
  ## Build the new box:
114
- <pre>
115
- $ vagrant basebox build 'myubuntubox'</pre>
126
+
127
+ $ vagrant basebox build 'myubuntubox'
116
128
 
117
129
  - This will create a machine + disk according to the definition.rb
118
130
  - Note: :os_type_id = The internal Name Virtualbox uses for that Distribution
@@ -124,12 +136,14 @@ $ vagrant basebox build 'myubuntubox'</pre>
124
136
  - Sudo execute the :postinstall_files
125
137
 
126
138
  ## Validate the vm
127
- <pre>$ vagrant basebox validate 'myubuntubox' </pre>
139
+
140
+ $ vagrant basebox validate 'myubuntubox'
128
141
 
129
142
  this will run some cucumber test against the box to see if it has the necessary bits and pieces for vagrant to work
130
143
 
131
144
  ## Export the vm to a .box file
132
- <pre>$ vagrant basebox export 'myubuntubox' </pre>
145
+
146
+ $ vagrant basebox export 'myubuntubox'
133
147
 
134
148
  this is actually calling - vagrant package --base 'myubuntubox' --output 'boxes/myubuntubox.box'
135
149
 
@@ -138,38 +152,32 @@ this will result in a myubuntubox.box
138
152
  ## Add the box as one of your boxes
139
153
  To import it into vagrant type:
140
154
 
141
- <pre>$ vagrant box add 'myubuntubox' 'myubuntubox.box'
142
- </pre>
155
+ $ vagrant box add 'myubuntubox' 'myubuntubox.box'
156
+
143
157
  ## Use it in vagrant
144
158
 
145
159
  To use it:
146
- <pre>
147
- $ vagrant init 'myubuntubox'
148
- $ vagrant up
149
- $ vagrant ssh
150
- </pre>
160
+
161
+ $ vagrant init 'myubuntubox'
162
+ $ vagrant up
163
+ $ vagrant ssh
151
164
 
152
165
  ## How to add a new OS/installation (needs some love)
153
166
 
154
- - I suggest the easiest way is to get an account on github
155
- - fork of the veewee repository
167
+ I suggest the easiest way is to get an account on github and fork of the veewee repository
156
168
 
157
- <pre>
158
- $ git clone https://github.com/*your account*/veewee.git
159
- $ cd veewee
160
- $ gem install bundler
161
- $ bundle install
162
- </pre>
169
+ $ git clone https://github.com/*your account*/veewee.git
170
+ $ cd veewee
171
+ $ gem install bundler
172
+ $ bundle install
163
173
 
164
174
  If you don't use rvm, be sure to execute vagrant through bundle exec
165
- <pre>
166
- $ alias vagrant="bundle exec vagrant"
167
- </pre>
175
+
176
+ $ alias vagrant="bundle exec vagrant"
168
177
 
169
178
  Start of an existing one
170
- <pre>
171
- $ vagrant basebox define 'mynewos' 'ubuntu...'
172
- </pre>
179
+
180
+ $ vagrant basebox define 'mynewos' 'ubuntu...'
173
181
 
174
182
  - Do changes in the currentdir/definitions/mynewos
175
183
  - When it builds ok, move the definition/mynewos to a sensible directory under templates
@@ -70,9 +70,10 @@ class Command < Vagrant::Command::GroupBase
70
70
  end
71
71
 
72
72
  desc "validate [NAME]", "Validates a box against vagrant compliancy rules"
73
+ method_option :user,:default => "vagrant", :aliases => "-u", :desc => "user to login with"
73
74
  def validate(boxname)
74
75
  if (!boxname.nil?)
75
- Veewee::Session.validate_box(boxname)
76
+ Veewee::Session.validate_box(boxname,options)
76
77
  end
77
78
  end
78
79
 
@@ -93,10 +93,27 @@ module Veewee
93
93
  special['<KillX>'] = '1d 38 0e';
94
94
  special['<Wait>'] = 'wait';
95
95
 
96
- #special['<Up>'] = '01';
97
- #special['<Down>'] = '01';
98
- #special['<PageUp>'] = '01';
99
- #special['<PageDown>'] = '01';
96
+ special['<Up>'] = '48 c8';
97
+ special['<Down>'] = '50 d0';
98
+ special['<PageUp>'] = '49 c9';
99
+ special['<PageDown>'] = '51 d1';
100
+ special['<End>'] = '4f cf';
101
+ special['<Insert>'] = '52 d2';
102
+ special['<Delete>'] = '53 d3';
103
+ special['<Left>'] = '4b cb';
104
+ special['<Right>'] = '4d cd';
105
+ special['<Home>'] = '47 c7';
106
+
107
+ special['<F1>'] = '3b';
108
+ special['<F2>'] = '3c';
109
+ special['<F3>'] = '3d';
110
+ special['<F4>'] = '3e';
111
+ special['<F5>'] = '3f';
112
+ special['<F6>'] = '40';
113
+ special['<F7>'] = '41';
114
+ special['<F8>'] = '42';
115
+ special['<F9>'] = '43';
116
+ special['<F10>'] = '44';
100
117
 
101
118
  keycodes=''
102
119
  thestring.gsub!(/ /,"<Spacebar>")
@@ -696,13 +696,13 @@ module Veewee
696
696
  Socket.do_not_reverse_lookup = orig
697
697
  end
698
698
 
699
- def self.validate_box(boxname)
699
+ def self.validate_box(boxname,options)
700
700
  require 'cucumber'
701
701
 
702
702
  require 'cucumber/rspec/disable_option_parser'
703
703
  require 'cucumber/cli/main'
704
704
 
705
-
705
+ ENV['veewee_user']=options[:user]
706
706
  feature_path=File.join(File.dirname(__FILE__),"..","..","validation","vagrant.feature")
707
707
 
708
708
  features=Array.new
@@ -1,3 +1,3 @@
1
1
  module Veewee
2
- VERSION = "0.1.26"
2
+ VERSION = "0.1.27"
3
3
  end
@@ -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_64',
5
+ :iso_file => "CentOS-5.6-x86_64-netinstall.iso",
6
+ :iso_src => "http://mirror.ukhost4u.com/centos/5.6/isos/x86_64/CentOS-5.6-x86_64-netinstall.iso",
7
+ :iso_md5 => "02cf3a5e32aaa5eed27af775ad292beb",
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 => "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,45 @@
1
+ # Kickstart file automatically generated by anaconda.
2
+
3
+ install
4
+ url --url=http://mirror.bytemark.co.uk/centos/5.6/os/x86_64
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 Europe/London
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
+
41
+ %post
42
+ /usr/sbin/groupadd vagrant
43
+ /usr/sbin/useradd vagrant -g vagrant -G wheel
44
+ echo "vagrant"|passwd --stdin vagrant
45
+ echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
@@ -0,0 +1,58 @@
1
+ #http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/
2
+
3
+ fail()
4
+ {
5
+ echo "FATAL: $*"
6
+ exit 1
7
+ }
8
+
9
+ #kernel source is needed for vbox additions
10
+ yum -y install gcc bzip2 make kernel-devel-`uname -r`
11
+ #yum -y update
12
+ #yum -y upgrade
13
+
14
+ yum -y install gcc-c++ zlib-devel openssl-devel readline-devel sqlite3-devel
15
+ yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
16
+ yum -y clean all
17
+
18
+ #Installing ruby
19
+ cd /tmp
20
+ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.gz || fail "Could not download Ruby source"
21
+ tar xzvf ruby-1.9.2-p180.tar.gz
22
+ cd ruby-1.9.2-p180
23
+ ./configure
24
+ make && make install
25
+ cd /tmp
26
+ rm -rf /tmp/ruby-1.9.2-p180
27
+ rm /tmp/ruby-1.9.2-p180.tar.gz
28
+ ln -s /usr/local/bin/ruby /usr/bin/ruby # Create a sym link for the same path
29
+ ln -s /usr/local/bin/gem /usr/bin/gem # Create a sym link for the same path
30
+
31
+ #Installing chef & Puppet
32
+ echo "Installing chef and puppet"
33
+ /usr/local/bin/gem install chef --no-ri --no-rdoc || fail "Could not install chef"
34
+ /usr/local/bin/gem install puppet --no-ri --no-rdoc || fail "Could not install puppet"
35
+
36
+ #Installing vagrant keys
37
+ mkdir /home/vagrant/.ssh
38
+ chmod 700 /home/vagrant/.ssh
39
+ cd /home/vagrant/.ssh
40
+ wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
41
+ chown -R vagrant /home/vagrant/.ssh
42
+
43
+ #Installing the virtualbox guest additions
44
+ VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
45
+ cd /tmp
46
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
47
+ mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
48
+ sh /mnt/VBoxLinuxAdditions.run
49
+ umount /mnt
50
+
51
+ rm VBoxGuestAdditions_$VBOX_VERSION.iso
52
+
53
+
54
+ sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
55
+
56
+ #poweroff -h
57
+
58
+ exit