Template Changes/Additions #156

Merged
merged 8 commits into from Nov 25, 2011

Projects

None yet

4 participants

@ichilton

Hi Patrick,

Updated Debian and Added Ubuntu 11.10 and Debian Testing

Ian

@cmsimike

Ubuntu 11.10 template isn't 100%? I've found these errors while trying to build the box, from postinstall.sh

Package libreadline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libreadline-gplv2-dev:i386 lib64readline-gplv2-dev:i386
libreadline-gplv2-dev

E: Package 'libreadline5-dev' has no installation candidate

and

RubyGems installed the following executables:
/opt/ruby/bin/gem

ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand

These failures were reported during validation:
Failing Scenarios:
cucumber /Library/Ruby/Gems/1.8/gems/veewee-0.2.0/lib/veewee/../../validation/vagrant.feature:33 # Scenario: Checking chef
cucumber /Library/Ruby/Gems/1.8/gems/veewee-0.2.0/lib/veewee/../../validation/vagrant.feature:40 # Scenario: Checking puppet

7 scenarios (2 failed, 5 passed)
21 steps (2 failed, 19 passed)

@ichilton

Odd - seemed to work for me earlier....I must have done something daft, or not ran the tests on that one...oops.

I'll take a look.

Do the Debian ones seem ok?

Thanks,

Ian

@cmsimike

I haven't tested the debian. I BELIEVE you just need to replace libreadline5-dev with libreadline-gpl2-dev. I am trying that build now and will let you knwo when it is done.

@cmsimike

Well, that didn't work too well. I'm not going to be able to continue working on it until at least tomorrow.

@ichilton

Hi,

Thanks for looking - it'll probably be early next week when I can take a look as i'm away at the moment and only have my netbook with me!

Thanks,

Ian

@mattmcclean

Had the same problems. At the end I modified the postinstall.sh file to the following content to make it work by following the install hints on the Opscode Chef website. Luckily it installs ruby version 1.8.7 by default so puppet should also work.

# postinstall.sh created from Mitchell's official lucid32/64 baseboxes

date > /etc/vagrant_box_build_time

# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
apt-get -y update
apt-get -y upgrade
apt-get -y install linux-headers-$(uname -r) build-essential
# Install Ruby and other dependencies
apt-get -y install ruby ruby-dev libopenssl-ruby rdoc ri irb wget ssl-cert curl
apt-get clean

# Setup sudo to allow no-password sudo for "admin"
cp /etc/sudoers /etc/sudoers.orig
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers

# Install NFS client
apt-get -y install nfs-common 

# Install RubyGems 1.8.10
curl -O http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar zxf rubygems-1.8.10.tgz
cd rubygems-1.8.10
ruby setup.rb --no-format-executable
cd ..
rm -rf rubygems-1.8.10*

# Installing chef & Puppet
gem install chef --no-ri --no-rdoc
gem install puppet --no-ri --no-rdoc

# Installing vagrant keys
mkdir /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
cd /home/vagrant/.ssh
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh

# Installing the virtualbox guest additions
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt

rm VBoxGuestAdditions_$VBOX_VERSION.iso

# Remove items used for building, since they aren't needed anymore
apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove

# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY

# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp3/*

# Make sure Udev doesn't block our network
# http://6.ptmc.org/?p=164
echo "cleaning up udev rules"
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
rm /lib/udev/rules.d/75-persistent-net-generator.rules

echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces
exit

@ichilton

Thanks - i'll test this out!

@ichilton

Hi,

I've not got it working using the source yet, but it does pass all the tests straight away using:
apt-get install puppet chef

What's the reasoning behind using ruby, gems etc from source rather than using the ubuntu packages?

If we are going with source, should I try using 1.9.2 and the latest gems?

Building/testing the debian boxes to try them, as we speak.

Ian

@ichilton

Hi,

The Debian stable update tests out fine.

The Debian Testing update stalls on the validate - however, it also dawned on me that the testing image is auto-generated so the MD5 will change. I've therefore pushed a commit to remove it.

Ian

@ichilton

According to a post from James here, Puppet does support Ruby 1.9.2 now:
http://groups.google.com/group/puppet-users/browse_thread/thread/8597ad51f56b7c5a/32d499e3d8ade3b0

I'm just going to try building a box with 1.9.2 and the latest gems.

@ichilton

Ok, that latest commit should be ok now :)

@ichilton

Grr, just tried doing a fresh build of the 64-bit version and it is failing the ruby test...

@ichilton

ok, school boy error - i'd not committed the latest version!

I'll do some more full test builds tonight to ensure everything is ok.

@ichilton

Done more builds and all seems to be working ok now - passes all of the tests.

@jedi4ever jedi4ever merged commit ff4c19a into jedi4ever:master Nov 25, 2011
@jedi4ever
Owner

This pull request has been merged now; thanks for doing the hard work!

@ichilton

Thanks Patrick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment