-
-
Save rsanheim/165312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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