Skip to content

Instantly share code, notes, and snippets.

@julien51
Created August 3, 2009 00:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save julien51/160263 to your computer and use it in GitHub Desktop.
Save julien51/160263 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Setting up chef..."
sudo apt-get -y update
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert
cd /tmp
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
tar zxf rubygems-1.3.4.tgz
cd rubygems-1.3.4
sudo ruby setup.rb --no-ri --no-rdoc
sudo ln -sfv /usr/bin/gem1.8 /usr/bin/gem
sudo gem source -a http://gems.opscode.com/
sudo gem install ohai chef --no-ri --no-rdoc
echo 'file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"' > /tmp/solo.rb
echo '{ "chef": { "server_fqdn": "chef.domain.com" }, "recipes": "chef::client" }' > /tmp/chef.json
sudo chef-solo -c /tmp/solo.rb -j /tmp/chef.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz
chef-client
echo "Done! Please, register this client..."
echo "[Press any key when done]"
read
echo "Adding the node"
chef-client
echo "All set, you can now add a role to this node."
echo "[Press any key when done]"
read
echo "Configuring the node..."
chef-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment