Update location of bootstrap script to work with OSGi.

Update bootstrap script to match latest Chef releases.
This commit is contained in:
Chris Custine 2011-05-23 01:10:20 -06:00
parent 11c1f29e41
commit 45a6ddbe39
3 changed files with 22 additions and 24 deletions

View File

@ -19,16 +19,14 @@
package org.jclouds.chef.statements; package org.jclouds.chef.statements;
import java.io.IOException; import com.google.common.base.Throwables;
import java.util.Collections;
import javax.inject.Singleton;
import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.scriptbuilder.domain.OsFamily;
import org.jclouds.scriptbuilder.domain.Statement; import org.jclouds.scriptbuilder.domain.Statement;
import org.jclouds.util.Utils; import org.jclouds.util.Strings2;
import com.google.common.base.Throwables; import javax.inject.Singleton;
import java.io.IOException;
import java.util.Collections;
/** /**
* @author Adrian Cole * @author Adrian Cole
@ -38,8 +36,7 @@ public class InstallChefGems implements Statement {
@Override @Override
public String render(OsFamily family) { public String render(OsFamily family) {
try { try {
return Utils.toStringAndClose(InstallChefGems.class.getClassLoader().getResourceAsStream( return Strings2.toStringAndClose(getClass().getResourceAsStream("install-chef-gems.sh"));
"install-chef-gems.sh"));
} catch (IOException e) { } catch (IOException e) {
Throwables.propagate(e); Throwables.propagate(e);
return null; return null;

View File

@ -1,15 +0,0 @@
if [ ! -f /usr/bin/chef-client ]; then
apt-get update
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras
mkdir -p /tmp/bootchef
(
cd /tmp/bootchef
wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
tar xvf rubygems-1.3.6.tgz
cd rubygems-1.3.6
ruby setup.rb
cp /usr/bin/gem1.8 /usr/bin/gem
)
rm -rf /tmp/bootchef
gem install chef ohai --no-rdoc --no-ri --verbose
fi

View File

@ -0,0 +1,16 @@
if [ ! -f /usr/bin/chef-client ]; then
apt-get update -o Acquire::http::No-Cache=True
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras
# Comment next line for production controlled environments, this should be part of a recipe
apt-get -y upgrade
(
mkdir -p /tmp/bootchef
cd /tmp/bootchef
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar zxf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb --no-format-executable
rm -fr /tmp/bootchef
)
/usr/bin/gem install ohai chef --no-rdoc --no-ri --verbose
fi