Skip to content

Instantly share code, notes, and snippets.

@czottmann
Created May 26, 2011 19:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save czottmann/993853 to your computer and use it in GitHub Desktop.
Save czottmann/993853 to your computer and use it in GitHub Desktop.
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
bash -c '
if [ ! -f /usr/local/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev
cd /usr/src
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.bz2
tar xjf ruby-1.9.2-p180.tar.bz2
cd ruby-1.9.2-p180
./configure
make
make install
cd ext/openssl/
ruby extconf.rb
make
make install
cd ../ext/readline/
ruby extconf.rb
make
make install
fi
gem install ohai chef --no-rdoc --no-ri --verbose <%= '--prerelease' if @config[:prerelease] %>
mkdir -p /etc/chef
(
cat <<'EOP'
<%= IO.read(Chef::Config[:validation_key]) %>
EOP
) > /tmp/validation.pem
awk NF /tmp/validation.pem > /etc/chef/validation.pem
rm /tmp/validation.pem
(
cat <<'EOP'
log_level :info
log_location STDOUT
chef_server_url "<%= Chef::Config[:chef_server_url] %>"
validation_client_name "<%= Chef::Config[:validation_client_name] %>"
<% if @config[:chef_node_name] == nil %>
# Using default node name"
<% else %>
node_name "<%= @config[:chef_node_name] %>"
<% end %>
EOP
) > /etc/chef/client.rb
(
cat <<'EOP'
<%= { "run_list" => @run_list }.to_json %>
EOP
) > /etc/chef/first-boot.json
/usr/local/bin/chef-client -j /etc/chef/first-boot.json'
@mankind
Copy link

mankind commented Jun 6, 2011

thanks.

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