Skip to content
Browse files

Merge pull request #202 from stefancocora/master

Openbsd amd64/i386 templates
  • Loading branch information...
2 parents 6bf148f + aa121f8 commit 00cc849caf765c167a906ffef3fb57b8e5bf0a1e @jedi4ever committed Jan 7, 2012
View
28 templates/openbsd50_amd64/README
@@ -0,0 +1,28 @@
+The boxes come with:
+- ports system already installed
+- puppet and chef
+- check the postinstall.sh script to see what is built in the box on top of the default install
+- add/remove to your heart's content
+
+a. Easy to use boxes for experimentation
+- with puppet
+- with chef
+- with whatever else you can dream of :)
+
+b. Mount
+# freebsd mouting NFS patch for FreeBSD
+# https://github.com/mitchellh/vagrant/commit/8a0a1bddb5afc6b99cab595d6f3cc9a95bb1a509
+# OpenBSD will need patching to use it as NFS host
+From the validation steps just the mount step fails
+Virtualbox mount can be achieved using NFS mounts, it is not possible using the VBox tools since you can't compile them on OpenBSD
+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)
+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.
+3. use a shell provisioner and scp/rsync your manifests from the host to the guest
+
+
+c. Wait times
+I've commented in all the steps in the OpenBSD install (definitions.rb)
+Adjust the <Wait> times if your machine is slower/faster than those times.
+
+d. More on puppet usage with OpenBSD
+# http://puppetlabs.com/blog/guest-post-a-puffy-in-the-corporate-aquarium-the-sequel/
View
84 templates/openbsd50_amd64/definition.rb
@@ -0,0 +1,84 @@
+Veewee::Session.declare({
+ :cpu_count => '1', :memory_size=> '256',
+ :disk_size => '40960', :disk_format => 'VDI', :hostiocache => 'off',
+ :os_type_id => 'OpenBSD_64',
+ :iso_file => "install50.iso",
+ :iso_src => "http://ftp.plig.net/pub/OpenBSD/5.0/amd64/install50.iso",
+ :iso_md5 => "2b7d7ca2acc7f148bd92f065034f9f5a",
+ :iso_download_timeout => "1000",
+ :boot_wait => "40", :boot_cmd_sequence => [
+# I - install
+ 'I<Enter>',
+# set the keyboard
+ 'us<Enter>',
+# set the hostname
+ 'OpenBSD50-x64<Enter>',
+# Which nic to config ? [em0]
+ '<Enter>',
+# do you want dhcp ? [dhcp]
+ '<Enter>',
+ '<Wait>'*5,
+# IPV6 for em0 ? [none]
+ 'none<Enter>',
+# Which other nic do you wish to configure [done]
+ 'done<Enter>',
+# Manual netw configuration ? [no]
+ 'no<Enter>',
+# Pw for root account
+ 'vagrant<Enter>',
+ 'vagrant<Enter>',
+# Start sshd by default ? [yes]
+ 'yes<Enter>',
+# Start ntpd by default ? [yes]
+ 'no<Enter>',
+# Do you want the X window system [yes]
+ 'no<Enter>',
+# Setup a user ?
+ 'vagrant<Enter>',
+# Full username
+ 'vagrant<Enter>',
+# Pw for this user
+ 'vagrant<Enter>',
+ 'vagrant<Enter>',
+# Do you want to disable sshd for root ? [yes]
+ 'no<Enter>',
+# What timezone are you in ?
+ 'GB<Enter>',
+# Available disks [sd0]
+ '<Enter>',
+# Use DUIDs rather than device names in fstab ? [yes]
+ '<Enter>',
+# Use (W)whole disk or (E)edit MBR ? [whole]
+ 'W<Enter>',
+# Use (A)auto layout ... ? [a]
+ 'A<Enter>',
+ '<Wait>'*60,
+# location of the sets [cd]
+ 'cd<Enter>',
+# Available cd-roms : cd0
+ '<Enter>',
+# Pathneame to sets ? [5.0/amd64]
+ '<Enter>',
+# Remove games and X
+ '-game50.tgz<Enter>',
+ '-xbase50.tgz<Enter>',
+ '-xetc50.tgz<Enter>',
+ '-xshare50.tgz<Enter>',
+ '-xfont50.tgz<Enter>',
+ '-xserv50.tgz<Enter>',
+ 'done<Enter>',
+ '<Wait>'*90,
+# Done installing ?
+ 'done<Enter>',
+ '<Wait>'*6,
+# Install non-free firmware files on first boot ? [no] <-- don't know what this is so I'm saying no
+ 'no<Enter><Wait>',
+ 'reboot<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 => "sh '%f'",
+ :shutdown_cmd => "/sbin/halt -p",
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
+})
View
81 templates/openbsd50_amd64/postinstall.sh
@@ -0,0 +1,81 @@
+# set pkg path for users
+echo " "
+echo " Setting PKG_PATH for users "
+echo " "
+echo " export PKG_PATH=http://ftp.plig.net/pub/OpenBSD/`uname -r`/packages/`arch -s`/ " >> /root/.profile
+echo " export PKG_PATH=http://ftp.plig.net/pub/OpenBSD/`uname -r`/packages/`arch -s`/ ">> /home/vagrant/.profile
+
+# giving root & vagrant bash as shell
+echo " "
+echo " Giving root/vagrant bash as a shell "
+echo " "
+usermod -s /usr/local/bin/bash vagrant
+usermod -s /usr/local/bin/bash root
+
+# install wget/curl/bash/vim and its dependencies
+echo " "
+echo " Installing needed packages "
+echo " "
+export PKG_PATH=http://ftp.plig.net/pub/OpenBSD/`uname -r`/packages/`arch -s`/
+pkg_add wget curl bash vim-7.3.154p1-no_x11 rsync bzip2 ngrep
+pkg_add ruby-1.8.7.352p1
+pkg_add ruby-gems
+ ln -sf /usr/local/bin/gem18 /usr/local/bin/gem
+
+ ln -sf /usr/local/bin/ruby18 /usr/local/bin/ruby
+ ln -sf /usr/local/bin/erb18 /usr/local/bin/erb
+ ln -sf /usr/local/bin/irb18 /usr/local/bin/irb
+ ln -sf /usr/local/bin/rdoc18 /usr/local/bin/rdoc
+ ln -sf /usr/local/bin/ri18 /usr/local/bin/ri
+ ln -sf /usr/local/bin/testrb18 /usr/local/bin/testrb
+
+pkg_add ruby-iconv
+pkg_add ruby-puppet-2.7.1
+
+gem install chef --no-ri --no-rdoc
+
+
+/etc/rc.d/sendmail stop
+
+# Create puppet user/group
+echo " "
+echo " Creating puppet user / group "
+echo " "
+groupadd puppet
+useradd -g puppet -d /var/lib/puppet -s /usr/bin/false puppet
+
+
+# install the ports system for who wants to use it
+echo " "
+echo " Installing the ports system ! "
+echo " "
+cd /tmp
+wget http://ftp.plig.net/pub/OpenBSD/5.0/ports.tar.gz
+cd /usr
+sudo tar xzf /tmp/ports.tar.gz
+
+# sudo
+# Defaults requiretty is not present in the sudoers file
+# env_keep I'll leave it as it is since user's path is same or more comprehensive than root's path
+echo " "
+echo " Setting sudo to work with vagrant "
+echo " "
+echo "# Uncomment to allow people in group wheel to run all commands without a password" >> /etc/sudoers
+echo "%wheel ALL=(ALL) NOPASSWD: SETENV: ALL" >> /etc/sudoers
+
+# setup the vagrant key
+# you can replace this key-pair with your own generated ssh key-pair
+echo " "
+echo " Setting the vagrant ssh pub key "
+echo " "
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+chown vagrant.vagrant /home/vagrant/.ssh
+touch /home/vagrant/.ssh/authorized_keys
+curl -sL http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub > /home/vagrant/.ssh/authorized_keys
+chmod 600 /home/vagrant/.ssh/authorized_keys
+chown vagrant.vagrant /home/vagrant/.ssh/authorized_keys
+
+echo
+echo "Post-install done"
+exit 0
View
BIN templates/openbsd50_i386/.definition.rb.swp
Binary file not shown.
View
28 templates/openbsd50_i386/README
@@ -0,0 +1,28 @@
+The boxes come with:
+- ports system already installed
+- puppet and chef
+- check the postinstall.sh script to see what is built in the box on top of the default install
+- add/remove to your heart's content
+
+a. Easy to use boxes for experimentation
+- with puppet
+- with chef
+- with whatever else you can dream of :)
+
+b. Mount
+# freebsd mouting NFS patch for FreeBSD
+# https://github.com/mitchellh/vagrant/commit/8a0a1bddb5afc6b99cab595d6f3cc9a95bb1a509
+# OpenBSD will need patching to use it as NFS host
+From the validation steps just the mount step fails
+Virtualbox mount can be achieved using NFS mounts, it is not possible using the VBox tools since you can't compile them on OpenBSD
+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)
+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.
+3. use a shell provisioner and scp/rsync your manifests from the host to the guest
+
+
+c. Wait times
+I've commented in all the steps in the OpenBSD install (definitions.rb)
+Adjust the <Wait> times if your machine is slower/faster than those times.
+
+d. More on puppet usage with OpenBSD
+# http://puppetlabs.com/blog/guest-post-a-puffy-in-the-corporate-aquarium-the-sequel/
View
84 templates/openbsd50_i386/definition.rb
@@ -0,0 +1,84 @@
+Veewee::Session.declare({
+ :cpu_count => '1', :memory_size=> '256',
+ :disk_size => '40960', :disk_format => 'VDI', :hostiocache => 'off',
+ :os_type_id => 'OpenBSD_64',
+ :iso_file => "install50.iso",
+ :iso_src => "http://ftp.plig.net/pub/OpenBSD/5.0/i386/install50.iso",
+ :iso_md5 => "2f0cc4df7dfe095f15a8ddadf8a02f69",
+ :iso_download_timeout => "1000",
+ :boot_wait => "40", :boot_cmd_sequence => [
+# I - install
+ 'I<Enter>',
+# set the keyboard
+ 'us<Enter>',
+# set the hostname
+ 'OpenBSD50-x64<Enter>',
+# Which nic to config ? [em0]
+ '<Enter>',
+# do you want dhcp ? [dhcp]
+ '<Enter>',
+ '<Wait>'*5,
+# IPV6 for em0 ? [none]
+ 'none<Enter>',
+# Which other nic do you wish to configure [done]
+ 'done<Enter>',
+# Manual netw configuration ? [no]
+ 'no<Enter>',
+# Pw for root account
+ 'vagrant<Enter>',
+ 'vagrant<Enter>',
+# Start sshd by default ? [yes]
+ 'yes<Enter>',
+# Start ntpd by default ? [yes]
+ 'no<Enter>',
+# Do you want the X window system [yes]
+ 'no<Enter>',
+# Setup a user ?
+ 'vagrant<Enter>',
+# Full username
+ 'vagrant<Enter>',
+# Pw for this user
+ 'vagrant<Enter>',
+ 'vagrant<Enter>',
+# Do you want to disable sshd for root ? [yes]
+ 'no<Enter>',
+# What timezone are you in ?
+ 'GB<Enter>',
+# Available disks [sd0]
+ '<Enter>',
+# Use DUIDs rather than device names in fstab ? [yes]
+ '<Enter>',
+# Use (W)whole disk or (E)edit MBR ? [whole]
+ 'W<Enter>',
+# Use (A)auto layout ... ? [a]
+ 'A<Enter>',
+ '<Wait>'*60,
+# location of the sets [cd]
+ 'cd<Enter>',
+# Available cd-roms : cd0
+ '<Enter>',
+# Pathneame to sets ? [5.0/amd64]
+ '<Enter>',
+# Remove games and X
+ '-game50.tgz<Enter>',
+ '-xbase50.tgz<Enter>',
+ '-xetc50.tgz<Enter>',
+ '-xshare50.tgz<Enter>',
+ '-xfont50.tgz<Enter>',
+ '-xserv50.tgz<Enter>',
+ 'done<Enter>',
+ '<Wait>'*90,
+# Done installing ?
+ 'done<Enter>',
+ '<Wait>'*6,
+# Install non-free firmware files on first boot ? [no] <-- don't know what this is so I'm saying no
+ 'no<Enter><Wait>',
+ 'reboot<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 => "sh '%f'",
+ :shutdown_cmd => "/sbin/halt -p",
+ :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
+})
View
80 templates/openbsd50_i386/postinstall.sh
@@ -0,0 +1,80 @@
+# set pkg path for users
+echo " "
+echo " Setting PKG_PATH for users "
+echo " "
+echo " export PKG_PATH=http://ftp.plig.net/pub/OpenBSD/`uname -r`/packages/`arch -s`/ " >> /root/.profile
+echo " export PKG_PATH=http://ftp.plig.net/pub/OpenBSD/`uname -r`/packages/`arch -s`/ ">> /home/vagrant/.profile
+
+# giving root & vagrant bash as shell
+echo " "
+echo " Giving root/vagrant bash as a shell "
+echo " "
+usermod -s /usr/local/bin/bash vagrant
+usermod -s /usr/local/bin/bash root
+
+# install wget/curl/bash/vim and its dependencies
+echo " "
+echo " Installing needed packages "
+echo " "
+export PKG_PATH=http://ftp.plig.net/pub/OpenBSD/`uname -r`/packages/`arch -s`/
+pkg_add wget curl bash vim-7.3.154p1-no_x11 rsync bzip2 ngrep
+pkg_add ruby-1.8.7.352p1
+pkg_add ruby-gems
+ ln -sf /usr/local/bin/gem18 /usr/local/bin/gem
+
+ ln -sf /usr/local/bin/ruby18 /usr/local/bin/ruby
+ ln -sf /usr/local/bin/erb18 /usr/local/bin/erb
+ ln -sf /usr/local/bin/irb18 /usr/local/bin/irb
+ ln -sf /usr/local/bin/rdoc18 /usr/local/bin/rdoc
+ ln -sf /usr/local/bin/ri18 /usr/local/bin/ri
+ ln -sf /usr/local/bin/testrb18 /usr/local/bin/testrb
+
+pkg_add ruby-iconv
+pkg_add ruby-puppet-2.7.1
+
+gem install chef --no-ri --no-rdoc
+
+/etc/rc.d/sendmail stop
+
+# Create puppet user/group
+echo " "
+echo " Creating puppet user / group "
+echo " "
+groupadd puppet
+useradd -g puppet -d /var/lib/puppet -s /usr/bin/false puppet
+
+
+# install the ports system for who wants to use it
+echo " "
+echo " Installing the ports system ! "
+echo " "
+cd /tmp
+wget http://ftp.plig.net/pub/OpenBSD/5.0/ports.tar.gz
+cd /usr
+sudo tar xzf /tmp/ports.tar.gz
+
+# sudo
+# Defaults requiretty is not present in the sudoers file
+# env_keep I'll leave it as it is since user's path is same or more comprehensive than root's path
+echo " "
+echo " Setting sudo to work with vagrant "
+echo " "
+echo "# Uncomment to allow people in group wheel to run all commands without a password" >> /etc/sudoers
+echo "%wheel ALL=(ALL) NOPASSWD: SETENV: ALL" >> /etc/sudoers
+
+# setup the vagrant key
+# you can replace this key-pair with your own generated ssh key-pair
+echo " "
+echo " Setting the vagrant ssh pub key "
+echo " "
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+chown vagrant.vagrant /home/vagrant/.ssh
+touch /home/vagrant/.ssh/authorized_keys
+curl -sL http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub > /home/vagrant/.ssh/authorized_keys
+chmod 600 /home/vagrant/.ssh/authorized_keys
+chown vagrant.vagrant /home/vagrant/.ssh/authorized_keys
+
+echo
+echo "Post-install done"
+exit 0

0 comments on commit 00cc849

Please sign in to comment.
Something went wrong with that request. Please try again.