veewee 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/README.md +1 -1
- data/doc/definition.md +18 -0
- data/doc/kvm.md +28 -1
- data/doc/template.md +53 -2
- data/lib/veewee/command/fusion.rb +37 -3
- data/lib/veewee/command/vagrant/basebox.rb +2 -0
- data/lib/veewee/command/vagrant/winrm.rb +39 -0
- data/lib/veewee/command/vbox.rb +18 -0
- data/lib/veewee/definition.rb +13 -3
- data/lib/veewee/error.rb +3 -0
- data/lib/veewee/provider/core/box.rb +7 -0
- data/lib/veewee/provider/core/box/build.rb +34 -14
- data/lib/veewee/provider/core/box/copy.rb +17 -0
- data/lib/veewee/provider/core/box/exec.rb +31 -12
- data/lib/veewee/provider/core/box/floppy.rb +1 -0
- data/lib/veewee/provider/core/box/halt.rb +7 -3
- data/lib/veewee/provider/core/box/validate_tags.rb +8 -2
- data/lib/veewee/provider/core/box/wincp.rb +120 -0
- data/lib/veewee/provider/core/box/winrm.rb +59 -0
- data/lib/veewee/provider/core/helper/comm.rb +47 -0
- data/lib/veewee/provider/core/helper/web.rb +20 -9
- data/lib/veewee/provider/core/helper/winrm.rb +167 -0
- data/lib/veewee/provider/kvm/box/create.rb +59 -3
- data/lib/veewee/provider/kvm/provider.rb +6 -6
- data/lib/veewee/provider/parallels/box/helper/buildinfo.rb +1 -1
- data/lib/veewee/provider/virtualbox/box.rb +1 -0
- data/lib/veewee/provider/virtualbox/box/build.rb +4 -2
- data/lib/veewee/provider/virtualbox/box/create.rb +32 -12
- data/lib/veewee/provider/virtualbox/box/helper/buildinfo.rb +6 -3
- data/lib/veewee/provider/virtualbox/box/helper/create.rb +20 -5
- data/lib/veewee/provider/virtualbox/box/helper/winrm_options.rb +31 -0
- data/lib/veewee/provider/virtualbox/box/up.rb +33 -12
- data/lib/veewee/provider/virtualbox/box/winrm.rb +13 -0
- data/lib/veewee/provider/vmfusion/box.rb +2 -0
- data/lib/veewee/provider/vmfusion/box/add_share.rb +18 -0
- data/lib/veewee/provider/vmfusion/box/build.rb +3 -1
- data/lib/veewee/provider/vmfusion/box/create.rb +7 -2
- data/lib/veewee/provider/vmfusion/box/helper/buildinfo.rb +9 -6
- data/lib/veewee/provider/vmfusion/box/helper/ip.rb +1 -1
- data/lib/veewee/provider/vmfusion/box/helper/winrm_options.rb +21 -0
- data/lib/veewee/provider/vmfusion/box/template.rb +7 -3
- data/lib/veewee/provider/vmfusion/box/template.vmx.erb +6 -0
- data/lib/veewee/provider/vmfusion/box/winrm.rb +12 -0
- data/lib/veewee/provider/vmfusion/provider.rb +7 -1
- data/lib/veewee/version.rb +1 -1
- data/templates/CentOS-5.6-x86_64-netboot-packages/definition.rb +16 -0
- data/templates/CentOS-5.6-x86_64-netboot-packages/ks.cfg +47 -0
- data/templates/CentOS-5.6-x86_64-netboot-packages/postinstall.sh +61 -0
- data/templates/Debian-7.0-b3-amd64-netboot/base.sh +27 -0
- data/templates/Debian-7.0-b3-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-7.0-b3-amd64-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-7.0-b3-amd64-netboot/cleanup.sh +17 -0
- data/templates/Debian-7.0-b3-amd64-netboot/definition.rb +51 -0
- data/templates/Debian-7.0-b3-amd64-netboot/preseed.cfg +313 -0
- data/templates/Debian-7.0-b3-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-7.0-b3-amd64-netboot/ruby.sh +10 -0
- data/templates/Debian-7.0-b3-amd64-netboot/vagrant.sh +25 -0
- data/templates/Debian-7.0-b3-amd64-netboot/virtualbox.sh +13 -0
- data/templates/Debian-7.0-b3-amd64-netboot/zerodisk.sh +3 -0
- data/templates/Fedora-18-i386/definition.rb +17 -0
- data/templates/Fedora-18-i386/ks.cfg +75 -0
- data/templates/Fedora-18-i386/postinstall.sh +38 -0
- data/templates/Fedora-18-x86_64/definition.rb +17 -0
- data/templates/Fedora-18-x86_64/ks.cfg +75 -0
- data/templates/Fedora-18-x86_64/postinstall.sh +38 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/base.sh +30 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/chef.sh +3 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/cleanup.sh +5 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/definition.rb +40 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/ks.cfg +42 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/puppet.sh +12 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/ruby.sh +3 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/vagrant.sh +18 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/virtualbox.sh +8 -0
- data/templates/OracleLinux-6.3-x86_64-DVD/zerodisk.sh +3 -0
- data/templates/funtoo-latest-x86_64/definition.rb +37 -0
- data/templates/funtoo-latest-x86_64/postinstall.sh +401 -0
- data/templates/openbsd50_amd64/definition.rb +3 -2
- data/templates/openbsd50_amd64/postinstall.sh +4 -4
- data/templates/openbsd50_i386/definition.rb +4 -4
- data/templates/openbsd52_amd64/README +28 -0
- data/templates/openbsd52_amd64/definition.rb +85 -0
- data/templates/openbsd52_amd64/postinstall.sh +81 -0
- data/templates/openbsd52_i386/README +28 -0
- data/templates/openbsd52_i386/definition.rb +85 -0
- data/templates/openbsd52_i386/postinstall.sh +81 -0
- data/templates/windows-2008R1-serverstandard-amd64/Autounattend.xml +6 -6
- data/templates/windows-2008R1-serverweb-amd64/install-winrm.bat +1 -1
- data/templates/windows-2008R2-serverstandard-amd64-winrm/Autounattend.xml +224 -0
- data/templates/windows-2008R2-serverstandard-amd64-winrm/README.md +87 -0
- data/templates/windows-2008R2-serverstandard-amd64-winrm/definition.rb +33 -0
- data/templates/windows-2008R2-serverstandard-amd64-winrm/install-chef.bat +2 -0
- data/templates/windows-2008R2-serverstandard-amd64-winrm/install-vbox.bat +4 -0
- data/templates/windows-2008R2-serverstandard-amd64-winrm/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverstandard-amd64-winrm/postinstall.sh +74 -0
- data/templates/windows-7-enterprise-amd64-winrm/Autounattend.xml +227 -0
- data/templates/windows-7-enterprise-amd64-winrm/README.md +52 -0
- data/templates/windows-7-enterprise-amd64-winrm/definition.rb +27 -0
- data/templates/windows-7-enterprise-amd64-winrm/install-chef.bat +2 -0
- data/templates/windows-7-enterprise-amd64-winrm/install-fusion.bat +18 -0
- data/templates/windows-7-enterprise-amd64-winrm/install-puppet.bat +4 -0
- data/templates/windows-7-enterprise-amd64-winrm/install-vbox.bat +4 -0
- data/templates/windows-7-enterprise-amd64-winrm/oracle-cert.cer +0 -0
- data/templates/windows-7-enterprise-amd64-winrm/postinstall.bat +74 -0
- data/validation/veewee-windows.feature +34 -0
- data/veewee.gemspec +1 -1
- metadata +73 -7
@@ -2,8 +2,8 @@ Veewee::Session.declare({
|
|
2
2
|
:cpu_count => '1', :memory_size=> '256',
|
3
3
|
:disk_size => '40960', :disk_format => 'VDI', :hostiocache => 'off',
|
4
4
|
:os_type_id => 'OpenBSD_64',
|
5
|
-
:iso_file => "
|
6
|
-
:iso_src => "http://
|
5
|
+
:iso_file => "openbsd50_64.iso",
|
6
|
+
:iso_src => "http://ftp3.usa.openbsd.org/pub/OpenBSD/5.0/amd64/install50.iso",
|
7
7
|
:iso_md5 => "2b7d7ca2acc7f148bd92f065034f9f5a",
|
8
8
|
:iso_download_timeout => "1000",
|
9
9
|
:boot_wait => "40", :boot_cmd_sequence => [
|
@@ -71,6 +71,7 @@ Veewee::Session.declare({
|
|
71
71
|
# Done installing ?
|
72
72
|
'done<Enter>',
|
73
73
|
'<Wait>'*6,
|
74
|
+
'<Enter><Wait>',
|
74
75
|
# Install non-free firmware files on first boot ? [no] <-- don't know what this is so I'm saying no
|
75
76
|
'no<Enter><Wait>',
|
76
77
|
'reboot<Enter>'
|
@@ -2,8 +2,8 @@
|
|
2
2
|
echo " "
|
3
3
|
echo " Setting PKG_PATH for users "
|
4
4
|
echo " "
|
5
|
-
echo " export PKG_PATH=http://
|
6
|
-
echo " export PKG_PATH=http://
|
5
|
+
echo " export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/ " >> /root/.profile
|
6
|
+
echo " export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/ ">> /home/vagrant/.profile
|
7
7
|
|
8
8
|
# giving root & vagrant bash as shell
|
9
9
|
echo " "
|
@@ -16,7 +16,7 @@ usermod -s /usr/local/bin/bash root
|
|
16
16
|
echo " "
|
17
17
|
echo " Installing needed packages "
|
18
18
|
echo " "
|
19
|
-
export PKG_PATH=http://
|
19
|
+
export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/
|
20
20
|
pkg_add wget curl bash vim-7.3.154p1-no_x11 rsync bzip2 ngrep
|
21
21
|
pkg_add ruby-1.8.7.352p1
|
22
22
|
pkg_add ruby-gems
|
@@ -50,7 +50,7 @@ echo " "
|
|
50
50
|
echo " Installing the ports system ! "
|
51
51
|
echo " "
|
52
52
|
cd /tmp
|
53
|
-
wget http://
|
53
|
+
wget http://ftp3.usa.openbsd.org/pub/OpenBSD/5.0/ports.tar.gz
|
54
54
|
cd /usr
|
55
55
|
sudo tar xzf /tmp/ports.tar.gz
|
56
56
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Veewee::Session.declare({
|
2
2
|
:cpu_count => '1', :memory_size=> '256',
|
3
3
|
:disk_size => '40960', :disk_format => 'VDI', :hostiocache => 'off',
|
4
|
-
:os_type_id => '
|
5
|
-
:iso_file => "
|
4
|
+
:os_type_id => 'OpenBSD_32',
|
5
|
+
:iso_file => "openbsd50_32.iso",
|
6
6
|
:iso_src => "http://ftp.plig.net/pub/OpenBSD/5.0/i386/install50.iso",
|
7
7
|
:iso_md5 => "2f0cc4df7dfe095f15a8ddadf8a02f69",
|
8
8
|
:iso_download_timeout => "1000",
|
@@ -12,7 +12,7 @@ Veewee::Session.declare({
|
|
12
12
|
# set the keyboard
|
13
13
|
'us<Enter>',
|
14
14
|
# set the hostname
|
15
|
-
'OpenBSD50-
|
15
|
+
'OpenBSD50-x32<Enter>',
|
16
16
|
# Which nic to config ? [em0]
|
17
17
|
'<Enter>',
|
18
18
|
# do you want dhcp ? [dhcp]
|
@@ -57,7 +57,7 @@ Veewee::Session.declare({
|
|
57
57
|
'cd<Enter>',
|
58
58
|
# Available cd-roms : cd0
|
59
59
|
'<Enter>',
|
60
|
-
# Pathneame to sets ? [5.0/
|
60
|
+
# Pathneame to sets ? [5.0/i386]
|
61
61
|
'<Enter>',
|
62
62
|
# Remove games and X
|
63
63
|
'-game50.tgz<Enter>',
|
@@ -0,0 +1,28 @@
|
|
1
|
+
The boxes come with:
|
2
|
+
- ports system already installed
|
3
|
+
- puppet and chef
|
4
|
+
- check the postinstall.sh script to see what is built in the box on top of the default install
|
5
|
+
- add/remove to your heart's content
|
6
|
+
|
7
|
+
a. Easy to use boxes for experimentation
|
8
|
+
- with puppet
|
9
|
+
- with chef
|
10
|
+
- with whatever else you can dream of :)
|
11
|
+
|
12
|
+
b. Mount
|
13
|
+
# freebsd mouting NFS patch for FreeBSD
|
14
|
+
# https://github.com/mitchellh/vagrant/commit/8a0a1bddb5afc6b99cab595d6f3cc9a95bb1a509
|
15
|
+
# OpenBSD will need patching to use it as NFS host
|
16
|
+
From the validation steps just the mount step fails
|
17
|
+
Virtualbox mount can be achieved using NFS mounts, it is not possible using the VBox tools since you can't compile them on OpenBSD
|
18
|
+
1. you can have your host expose NFS mounts that can be mounted by the Openbsd guest (checkout the vagrant documentation on using NFS mounts)
|
19
|
+
2. another way can be to work with vagrant in Puppet-server / chef-server mode since it will get manifests over the network from the puppet/chef server.
|
20
|
+
3. use a shell provisioner and scp/rsync your manifests from the host to the guest
|
21
|
+
|
22
|
+
|
23
|
+
c. Wait times
|
24
|
+
I've commented in all the steps in the OpenBSD install (definitions.rb)
|
25
|
+
Adjust the <Wait> times if your machine is slower/faster than those times.
|
26
|
+
|
27
|
+
d. More on puppet usage with OpenBSD
|
28
|
+
# http://puppetlabs.com/blog/guest-post-a-puffy-in-the-corporate-aquarium-the-sequel/
|
@@ -0,0 +1,85 @@
|
|
1
|
+
Veewee::Session.declare({
|
2
|
+
:cpu_count => '1', :memory_size=> '256',
|
3
|
+
:disk_size => '40960', :disk_format => 'VDI', :hostiocache => 'off',
|
4
|
+
:os_type_id => 'OpenBSD_64',
|
5
|
+
:iso_file => "openbsd52_64.iso",
|
6
|
+
:iso_src => "http://ftp3.usa.openbsd.org/pub/OpenBSD/5.2/amd64/install52.iso",
|
7
|
+
:iso_md5 => "a10f51d910052b477147e198c08089f8",
|
8
|
+
:iso_download_timeout => "1000",
|
9
|
+
:boot_wait => "40", :boot_cmd_sequence => [
|
10
|
+
# I - install
|
11
|
+
'I<Enter>',
|
12
|
+
# set the keyboard
|
13
|
+
'us<Enter>',
|
14
|
+
# set the hostname
|
15
|
+
'OpenBSD52-x64<Enter>',
|
16
|
+
# Which nic to config ? [em0]
|
17
|
+
'<Enter>',
|
18
|
+
# do you want dhcp ? [dhcp]
|
19
|
+
'<Enter>',
|
20
|
+
'<Wait>'*5,
|
21
|
+
# IPV6 for em0 ? [none]
|
22
|
+
'none<Enter>',
|
23
|
+
# Which other nic do you wish to configure [done]
|
24
|
+
'done<Enter>',
|
25
|
+
# Pw for root account
|
26
|
+
'vagrant<Enter>',
|
27
|
+
'vagrant<Enter>',
|
28
|
+
# Start sshd by default ? [yes]
|
29
|
+
'yes<Enter>',
|
30
|
+
# Start ntpd by default ? [yes]
|
31
|
+
'no<Enter>',
|
32
|
+
# Do you want the X window system [yes]
|
33
|
+
'no<Enter>',
|
34
|
+
# Setup a user ?
|
35
|
+
'vagrant<Enter>',
|
36
|
+
# Full username
|
37
|
+
'vagrant<Enter>',
|
38
|
+
# Pw for this user
|
39
|
+
'vagrant<Enter>',
|
40
|
+
'vagrant<Enter>',
|
41
|
+
# Do you want to disable sshd for root ? [yes]
|
42
|
+
'no<Enter>',
|
43
|
+
# What timezone are you in ?
|
44
|
+
'GB<Enter>',
|
45
|
+
# Available disks [sd0]
|
46
|
+
'<Enter>',
|
47
|
+
# Use DUIDs rather than device names in fstab ? [yes]
|
48
|
+
'<Enter>',
|
49
|
+
# Use (W)whole disk or (E)edit MBR ? [whole]
|
50
|
+
'W<Enter>',
|
51
|
+
# Use (A)auto layout ... ? [a]
|
52
|
+
'A<Enter>',
|
53
|
+
'<Wait>'*60,
|
54
|
+
# location of the sets [cd]
|
55
|
+
'cd<Enter>',
|
56
|
+
# Available cd-roms : cd0
|
57
|
+
'<Enter>',
|
58
|
+
# Pathneame to sets ? [5.2/amd64]
|
59
|
+
'<Enter>',
|
60
|
+
# Remove games and X
|
61
|
+
'-game52.tgz<Enter>',
|
62
|
+
'-xbase52.tgz<Enter>',
|
63
|
+
'-xetc52.tgz<Enter>',
|
64
|
+
'-xshare52.tgz<Enter>',
|
65
|
+
'-xfont52.tgz<Enter>',
|
66
|
+
'-xserv52.tgz<Enter>',
|
67
|
+
'done<Enter>',
|
68
|
+
'<Wait>'*90,
|
69
|
+
# Done installing ?
|
70
|
+
'done<Enter>',
|
71
|
+
# Time appears wrong. Set to ...? [yes]
|
72
|
+
'yes<Enter><Wait>',
|
73
|
+
'<Wait>'*6,
|
74
|
+
# Install non-free firmware files on first boot ? [no] <-- don't know what this is so I'm saying no
|
75
|
+
'no<Enter><Wait>',
|
76
|
+
'reboot<Enter>',
|
77
|
+
'<Wait>'*6
|
78
|
+
],
|
79
|
+
:kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "",
|
80
|
+
:ssh_login_timeout => "10000", :ssh_user => "root", :ssh_password => "vagrant", :ssh_key => "",
|
81
|
+
:ssh_host_port => "7222", :ssh_guest_port => "22",
|
82
|
+
:sudo_cmd => "sh '%f'",
|
83
|
+
:shutdown_cmd => "/sbin/halt -p",
|
84
|
+
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
|
85
|
+
})
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# set pkg path for users
|
2
|
+
echo " "
|
3
|
+
echo " Setting PKG_PATH for users "
|
4
|
+
echo " "
|
5
|
+
echo " export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/ " >> /root/.profile
|
6
|
+
echo " export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/ ">> /home/vagrant/.profile
|
7
|
+
|
8
|
+
# giving root & vagrant bash as shell
|
9
|
+
echo " "
|
10
|
+
echo " Giving root/vagrant bash as a shell "
|
11
|
+
echo " "
|
12
|
+
usermod -s /usr/local/bin/bash vagrant
|
13
|
+
usermod -s /usr/local/bin/bash root
|
14
|
+
|
15
|
+
# install wget/curl/bash/vim and its dependencies
|
16
|
+
echo " "
|
17
|
+
echo " Installing needed packages "
|
18
|
+
echo " "
|
19
|
+
export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/
|
20
|
+
pkg_add wget curl bash vim-7.3.154p2-no_x11 rsync-3.0.9 bzip2 ngrep
|
21
|
+
pkg_add ruby-1.9.3.194
|
22
|
+
pkg_add ruby-gems
|
23
|
+
ln -sf /usr/local/bin/gem19 /usr/local/bin/gem
|
24
|
+
|
25
|
+
ln -sf /usr/local/bin/ruby19 /usr/local/bin/ruby
|
26
|
+
ln -sf /usr/local/bin/erb19 /usr/local/bin/erb
|
27
|
+
ln -sf /usr/local/bin/irb19 /usr/local/bin/irb
|
28
|
+
ln -sf /usr/local/bin/rdoc19 /usr/local/bin/rdoc
|
29
|
+
ln -sf /usr/local/bin/ri19 /usr/local/bin/ri
|
30
|
+
ln -sf /usr/local/bin/testrb19 /usr/local/bin/testrb
|
31
|
+
|
32
|
+
pkg_add ruby-iconv
|
33
|
+
pkg_add ruby-puppet-2.7.14
|
34
|
+
|
35
|
+
gem install chef --no-ri --no-rdoc
|
36
|
+
|
37
|
+
|
38
|
+
/etc/rc.d/sendmail stop
|
39
|
+
|
40
|
+
# Create puppet user/group
|
41
|
+
echo " "
|
42
|
+
echo " Creating puppet user / group "
|
43
|
+
echo " "
|
44
|
+
groupadd puppet
|
45
|
+
useradd -g puppet -d /var/lib/puppet -s /usr/bin/false puppet
|
46
|
+
|
47
|
+
|
48
|
+
# install the ports system for who wants to use it
|
49
|
+
echo " "
|
50
|
+
echo " Installing the ports system ! "
|
51
|
+
echo " "
|
52
|
+
cd /tmp
|
53
|
+
wget http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/ports.tar.gz
|
54
|
+
cd /usr
|
55
|
+
sudo tar xzf /tmp/ports.tar.gz
|
56
|
+
|
57
|
+
# sudo
|
58
|
+
# Defaults requiretty is not present in the sudoers file
|
59
|
+
# env_keep I'll leave it as it is since user's path is same or more comprehensive than root's path
|
60
|
+
echo " "
|
61
|
+
echo " Setting sudo to work with vagrant "
|
62
|
+
echo " "
|
63
|
+
echo "# Uncomment to allow people in group wheel to run all commands without a password" >> /etc/sudoers
|
64
|
+
echo "%wheel ALL=(ALL) NOPASSWD: SETENV: ALL" >> /etc/sudoers
|
65
|
+
|
66
|
+
# setup the vagrant key
|
67
|
+
# you can replace this key-pair with your own generated ssh key-pair
|
68
|
+
echo " "
|
69
|
+
echo " Setting the vagrant ssh pub key "
|
70
|
+
echo " "
|
71
|
+
mkdir /home/vagrant/.ssh
|
72
|
+
chmod 700 /home/vagrant/.ssh
|
73
|
+
chown vagrant.vagrant /home/vagrant/.ssh
|
74
|
+
touch /home/vagrant/.ssh/authorized_keys
|
75
|
+
curl -sL http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub > /home/vagrant/.ssh/authorized_keys
|
76
|
+
chmod 600 /home/vagrant/.ssh/authorized_keys
|
77
|
+
chown vagrant.vagrant /home/vagrant/.ssh/authorized_keys
|
78
|
+
|
79
|
+
echo
|
80
|
+
echo "Post-install done"
|
81
|
+
exit 0
|
@@ -0,0 +1,28 @@
|
|
1
|
+
The boxes come with:
|
2
|
+
- ports system already installed
|
3
|
+
- puppet and chef
|
4
|
+
- check the postinstall.sh script to see what is built in the box on top of the default install
|
5
|
+
- add/remove to your heart's content
|
6
|
+
|
7
|
+
a. Easy to use boxes for experimentation
|
8
|
+
- with puppet
|
9
|
+
- with chef
|
10
|
+
- with whatever else you can dream of :)
|
11
|
+
|
12
|
+
b. Mount
|
13
|
+
# freebsd mouting NFS patch for FreeBSD
|
14
|
+
# https://github.com/mitchellh/vagrant/commit/8a0a1bddb5afc6b99cab595d6f3cc9a95bb1a509
|
15
|
+
# OpenBSD will need patching to use it as NFS host
|
16
|
+
From the validation steps just the mount step fails
|
17
|
+
Virtualbox mount can be achieved using NFS mounts, it is not possible using the VBox tools since you can't compile them on OpenBSD
|
18
|
+
1. you can have your host expose NFS mounts that can be mounted by the Openbsd guest (checkout the vagrant documentation on using NFS mounts)
|
19
|
+
2. another way can be to work with vagrant in Puppet-server / chef-server mode since it will get manifests over the network from the puppet/chef server.
|
20
|
+
3. use a shell provisioner and scp/rsync your manifests from the host to the guest
|
21
|
+
|
22
|
+
|
23
|
+
c. Wait times
|
24
|
+
I've commented in all the steps in the OpenBSD install (definitions.rb)
|
25
|
+
Adjust the <Wait> times if your machine is slower/faster than those times.
|
26
|
+
|
27
|
+
d. More on puppet usage with OpenBSD
|
28
|
+
# http://puppetlabs.com/blog/guest-post-a-puffy-in-the-corporate-aquarium-the-sequel/
|
@@ -0,0 +1,85 @@
|
|
1
|
+
Veewee::Session.declare({
|
2
|
+
:cpu_count => '1', :memory_size=> '256',
|
3
|
+
:disk_size => '40960', :disk_format => 'VDI', :hostiocache => 'off',
|
4
|
+
:os_type_id => 'OpenBSD_32',
|
5
|
+
:iso_file => "openbsd52_32.iso",
|
6
|
+
:iso_src => "http://ftp3.usa.openbsd.org/pub/OpenBSD/5.2/i386/install52.iso",
|
7
|
+
:iso_md5 => "a10f51d910052b477147e198c08089f8",
|
8
|
+
:iso_download_timeout => "1000",
|
9
|
+
:boot_wait => "40", :boot_cmd_sequence => [
|
10
|
+
# I - install
|
11
|
+
'I<Enter>',
|
12
|
+
# set the keyboard
|
13
|
+
'us<Enter>',
|
14
|
+
# set the hostname
|
15
|
+
'OpenBSD52-x32<Enter>',
|
16
|
+
# Which nic to config ? [em0]
|
17
|
+
'<Enter>',
|
18
|
+
# do you want dhcp ? [dhcp]
|
19
|
+
'<Enter>',
|
20
|
+
'<Wait>'*5,
|
21
|
+
# IPV6 for em0 ? [none]
|
22
|
+
'none<Enter>',
|
23
|
+
# Which other nic do you wish to configure [done]
|
24
|
+
'done<Enter>',
|
25
|
+
# Pw for root account
|
26
|
+
'vagrant<Enter>',
|
27
|
+
'vagrant<Enter>',
|
28
|
+
# Start sshd by default ? [yes]
|
29
|
+
'yes<Enter>',
|
30
|
+
# Start ntpd by default ? [yes]
|
31
|
+
'no<Enter>',
|
32
|
+
# Do you want the X window system [yes]
|
33
|
+
'no<Enter>',
|
34
|
+
# Setup a user ?
|
35
|
+
'vagrant<Enter>',
|
36
|
+
# Full username
|
37
|
+
'vagrant<Enter>',
|
38
|
+
# Pw for this user
|
39
|
+
'vagrant<Enter>',
|
40
|
+
'vagrant<Enter>',
|
41
|
+
# Do you want to disable sshd for root ? [yes]
|
42
|
+
'no<Enter>',
|
43
|
+
# What timezone are you in ?
|
44
|
+
'GB<Enter>',
|
45
|
+
# Available disks [sd0]
|
46
|
+
'<Enter>',
|
47
|
+
# Use DUIDs rather than device names in fstab ? [yes]
|
48
|
+
'<Enter>',
|
49
|
+
# Use (W)whole disk or (E)edit MBR ? [whole]
|
50
|
+
'W<Enter>',
|
51
|
+
# Use (A)auto layout ... ? [a]
|
52
|
+
'A<Enter>',
|
53
|
+
'<Wait>'*60,
|
54
|
+
# location of the sets [cd]
|
55
|
+
'cd<Enter>',
|
56
|
+
# Available cd-roms : cd0
|
57
|
+
'<Enter>',
|
58
|
+
# Pathneame to sets ? [5.2/i386]
|
59
|
+
'<Enter>',
|
60
|
+
# Remove games and X
|
61
|
+
'-game52.tgz<Enter>',
|
62
|
+
'-xbase52.tgz<Enter>',
|
63
|
+
'-xetc52.tgz<Enter>',
|
64
|
+
'-xshare52.tgz<Enter>',
|
65
|
+
'-xfont52.tgz<Enter>',
|
66
|
+
'-xserv52.tgz<Enter>',
|
67
|
+
'done<Enter>',
|
68
|
+
'<Wait>'*90,
|
69
|
+
# Done installing ?
|
70
|
+
'done<Enter>',
|
71
|
+
# Time appears wrong. Set to ...? [yes]
|
72
|
+
'yes<Enter><Wait>',
|
73
|
+
'<Wait>'*6,
|
74
|
+
# Install non-free firmware files on first boot ? [no] <-- don't know what this is so I'm saying no
|
75
|
+
'no<Enter><Wait>',
|
76
|
+
'reboot<Enter>',
|
77
|
+
'<Wait>'*6
|
78
|
+
],
|
79
|
+
:kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "",
|
80
|
+
:ssh_login_timeout => "10000", :ssh_user => "root", :ssh_password => "vagrant", :ssh_key => "",
|
81
|
+
:ssh_host_port => "7222", :ssh_guest_port => "22",
|
82
|
+
:sudo_cmd => "sh '%f'",
|
83
|
+
:shutdown_cmd => "/sbin/halt -p",
|
84
|
+
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
|
85
|
+
})
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# set pkg path for users
|
2
|
+
echo " "
|
3
|
+
echo " Setting PKG_PATH for users "
|
4
|
+
echo " "
|
5
|
+
echo " export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/ " >> /root/.profile
|
6
|
+
echo " export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/ ">> /home/vagrant/.profile
|
7
|
+
|
8
|
+
# giving root & vagrant bash as shell
|
9
|
+
echo " "
|
10
|
+
echo " Giving root/vagrant bash as a shell "
|
11
|
+
echo " "
|
12
|
+
usermod -s /usr/local/bin/bash vagrant
|
13
|
+
usermod -s /usr/local/bin/bash root
|
14
|
+
|
15
|
+
# install wget/curl/bash/vim and its dependencies
|
16
|
+
echo " "
|
17
|
+
echo " Installing needed packages "
|
18
|
+
echo " "
|
19
|
+
export PKG_PATH=http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/
|
20
|
+
pkg_add wget curl bash vim-7.3.154p2-no_x11 rsync-3.0.9 bzip2 ngrep
|
21
|
+
pkg_add ruby-1.9.3.194
|
22
|
+
pkg_add ruby-gems
|
23
|
+
ln -sf /usr/local/bin/gem19 /usr/local/bin/gem
|
24
|
+
|
25
|
+
ln -sf /usr/local/bin/ruby19 /usr/local/bin/ruby
|
26
|
+
ln -sf /usr/local/bin/erb19 /usr/local/bin/erb
|
27
|
+
ln -sf /usr/local/bin/irb19 /usr/local/bin/irb
|
28
|
+
ln -sf /usr/local/bin/rdoc19 /usr/local/bin/rdoc
|
29
|
+
ln -sf /usr/local/bin/ri19 /usr/local/bin/ri
|
30
|
+
ln -sf /usr/local/bin/testrb19 /usr/local/bin/testrb
|
31
|
+
|
32
|
+
pkg_add ruby-iconv
|
33
|
+
pkg_add ruby-puppet-2.7.14
|
34
|
+
|
35
|
+
gem install chef --no-ri --no-rdoc
|
36
|
+
|
37
|
+
|
38
|
+
/etc/rc.d/sendmail stop
|
39
|
+
|
40
|
+
# Create puppet user/group
|
41
|
+
echo " "
|
42
|
+
echo " Creating puppet user / group "
|
43
|
+
echo " "
|
44
|
+
groupadd puppet
|
45
|
+
useradd -g puppet -d /var/lib/puppet -s /usr/bin/false puppet
|
46
|
+
|
47
|
+
|
48
|
+
# install the ports system for who wants to use it
|
49
|
+
echo " "
|
50
|
+
echo " Installing the ports system ! "
|
51
|
+
echo " "
|
52
|
+
cd /tmp
|
53
|
+
wget http://ftp3.usa.openbsd.org/pub/OpenBSD/`uname -r`/ports.tar.gz
|
54
|
+
cd /usr
|
55
|
+
sudo tar xzf /tmp/ports.tar.gz
|
56
|
+
|
57
|
+
# sudo
|
58
|
+
# Defaults requiretty is not present in the sudoers file
|
59
|
+
# env_keep I'll leave it as it is since user's path is same or more comprehensive than root's path
|
60
|
+
echo " "
|
61
|
+
echo " Setting sudo to work with vagrant "
|
62
|
+
echo " "
|
63
|
+
echo "# Uncomment to allow people in group wheel to run all commands without a password" >> /etc/sudoers
|
64
|
+
echo "%wheel ALL=(ALL) NOPASSWD: SETENV: ALL" >> /etc/sudoers
|
65
|
+
|
66
|
+
# setup the vagrant key
|
67
|
+
# you can replace this key-pair with your own generated ssh key-pair
|
68
|
+
echo " "
|
69
|
+
echo " Setting the vagrant ssh pub key "
|
70
|
+
echo " "
|
71
|
+
mkdir /home/vagrant/.ssh
|
72
|
+
chmod 700 /home/vagrant/.ssh
|
73
|
+
chown vagrant.vagrant /home/vagrant/.ssh
|
74
|
+
touch /home/vagrant/.ssh/authorized_keys
|
75
|
+
curl -sL http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub > /home/vagrant/.ssh/authorized_keys
|
76
|
+
chmod 600 /home/vagrant/.ssh/authorized_keys
|
77
|
+
chown vagrant.vagrant /home/vagrant/.ssh/authorized_keys
|
78
|
+
|
79
|
+
echo
|
80
|
+
echo "Post-install done"
|
81
|
+
exit 0
|