Skip to content

Instantly share code, notes, and snippets.

@brynary
Created December 30, 2009 22:17
Show Gist options
  • Save brynary/266453 to your computer and use it in GitHub Desktop.
Save brynary/266453 to your computer and use it in GitHub Desktop.
# ec2-run-instances -k <key_name> ami-1515f67c
# Needed to be able to get Java packages later
sudo sed -i 's/universe/multiverse universe/' /etc/apt/sources.list
sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
# Accept the Sun Java license
echo 'sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true' | sudo debconf-set-selections
sudo apt-get install -y ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential zlib1g-dev libxml2-dev wget ssl-cert git-core couchdb rabbitmq-server sun-java6-jdk sun-java6-jre
sudo rabbitmqctl add_vhost /chef
sudo rabbitmqctl add_user chef testing
sudo rabbitmqctl set_permissions -p /chef chef ".*" ".*" ".*"
echo "gem: --no-rdoc --no-ri" >> ~/.gemrc
cd /tmp && wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar zxf rubygems-1.3.5.tgz && cd rubygems-1.3.5
sudo ruby setup.rb --no-ri --no-rdoc
sudo ln -sfv /usr/bin/gem1.8 /usr/bin/gem
sudo gem install rake rspec cucumber jeweler merb-core
cd && mkdir src && cd src
git clone git://github.com/opscode/mixlib-log
cd mixlib-log && sudo rake install && cd ..
git clone git://github.com/opscode/mixlib-authentication.git
cd mixlib-authentication && sudo rake install && cd ..
# Need CHEF-835 hack fix or WebUI won't boot, so using my repo for now
git clone git://github.com/brynary/chef.git
cd chef && git checkout origin/CHEF-835 && sudo rake install && cd chef-solr/bin && sudo cp * /usr/bin && cd
sudo mkdir -p /var/log/chef
sudo mkdir -p /etc/chef
cd /etc/chef
sudo wget http://gist.github.com/raw/266436/0bf36342ae402e15e15f7b13195e81f8762ae3b3/client.rb
sudo wget http://gist.github.com/raw/266436/612930db5d8a0ce3e1e7b3d45fecfdf7bec1a7e4/server.rb
cd
# In screen:
sudo chef-solr
sudo chef-solr-indexer
sudo chef-server
cd ~/src/chef/chef-server-webui/ && sudo slice -p 4001 -a thin
# Verify chef-client works:
sudo chef-client
# Login to the WebUI (running on Port 4001) with: admin / p@ssw0rd1
# Change default password
# Clients > Create:
# Name: knife
# Admin: true
# Save private key to ~/.chef/key.pem
knife configure -u knife
# Your chef server URL? http://localhost:4000/
# Verify knife works:
knife node list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment