This commit is contained in:
John Bintz 2012-05-03 09:30:32 -04:00
parent df6bdfc9e2
commit c277534c30
3 changed files with 44 additions and 5 deletions

View File

@ -0,0 +1,25 @@
Capistrano::Configuration.instance.load do
server '127.0.0.1:2222', :vagrant
ssh_options[:port] = 2222
set(:user) { 'vagrant' }
set(:password) { 'vagrant' }
task :ensure_puppet do
require 'socket'
begin
p = TCPSocket.new('localhost', 2222)
p.close
rescue Errno::ECONNREFUSED
system %{vagrant up}
p = TCPSocket.new('localhost', 2222)
p.close
end
end
before 'apply', 'ensure_puppet'
before 'bootstrap', 'ensure_puppet'
end

View File

@ -1,11 +1,12 @@
class ruby($version) { class ruby($version, $configure = "--disable-install-doc", $build_path = '') {
$path = bin_path($name) $path = bin_path($name)
$with_ruby_path = "${path}:${base::path}" $with_ruby_path = "${path}:${base::path}"
build_and_install { $name: build_and_install { $name:
version => $version, version => $version,
source => "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-<%= version %>.tar.gz", source => "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-<%= version %>.tar.gz",
configure => "--disable-install-doc" configure => $configure,
path => "${base::path}:${path}:${build_path}"
} }
gem { [ 'bundler', 'penchant' ]: gem { [ 'bundler', 'penchant' ]:

View File

@ -8,7 +8,20 @@ if [ ! -f ${base_dir}/ruby-base/bin/ruby ]; then
mkdir -p ${base_dir}/tmp mkdir -p ${base_dir}/tmp
cd ${base_dir}/tmp cd ${base_dir}/tmp
RUBY=ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.9.2-p290.tar.bz2 opt_dir=${base_dir}/tmp/ruby-opt
rm -Rf yaml-0.1.4*
curl -O http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar zxvf yaml-0.1.4.tar.gz
mv yaml-0.1.4 yaml-0.1.4-base
cd yaml-0.1.4-base
./configure --prefix=${opt_dir}
make
make install
cd ..
RUBY=ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.9.3-p194.tar.bz2
RUBY_FILENAME=${RUBY##*/} RUBY_FILENAME=${RUBY##*/}
RUBY_VERSION=${RUBY_FILENAME%%.tar.bz2} RUBY_VERSION=${RUBY_FILENAME%%.tar.bz2}
curl $RUBY > $RUBY_FILENAME curl $RUBY > $RUBY_FILENAME
@ -18,7 +31,7 @@ if [ ! -f ${base_dir}/ruby-base/bin/ruby ]; then
cd "$RUBY_VERSION-base" cd "$RUBY_VERSION-base"
./configure --prefix=${base_dir}/ruby-base --disable-pthread ./configure --prefix=${base_dir}/ruby-base --with-opt-dir=${opt_dir} --disable-pthread --disable-install-doc
make make
make install make install
@ -32,7 +45,7 @@ PATH=${base_dir}/ruby-base/bin:$PATH
if [ ! -f ${base_dir}/ruby-base/bin/puppet ]; then if [ ! -f ${base_dir}/ruby-base/bin/puppet ]; then
echo "Installing Puppet..." echo "Installing Puppet..."
gem install puppet gem install puppet --no-ri --no-rdoc
fi fi
mkdir -p ~/.puppet mkdir -p ~/.puppet