Forked from bmarini/chef-server-virtualbox-bootstrap.sh
Created
December 27, 2011 11:04
-
-
Save alessandro-fazzi/1523306 to your computer and use it in GitHub Desktop.
Quick start to setup a chef server on virtualbox (debian)
This file contains hidden or 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 | |
# | |
# Install virtualbox: | |
# - http://www.virtualbox.org/wiki/Downloads | |
# - Download iso: http://releases.ubuntu.com/10.10/ | |
# - Create a new virtualbox using the iso as the install media | |
# - Change network adapter to bridged | |
# - Use ifconfig to get ip address | |
# | |
# Once you have a clean install of debien... | |
# | |
# This script must me run as root or with "su -c [script]" command | |
# ssh: | |
apt-get install openssl-server | |
ufw enable | |
ufw allow 22 | |
# bootstrap chef | |
# http://wiki.opscode.com/display/chef/Bootstrap+Chef+RubyGems+Installation | |
apt-get install ruby ruby-dev libopenssl-ruby rdoc ri irb build-essential wget ssl-cert vim | |
# rubygems: | |
cd /tmp | |
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 | |
# chef: | |
gem install chef | |
mkdir -p /etc/chef | |
cat > /etc/chef/solo.rb <<EOF | |
file_cache_path "/tmp/chef-solo" | |
cookbook_path "/tmp/chef-solo/cookbooks" | |
EOF | |
cat > ~/chef.json <<EOF | |
{ | |
"chef": { | |
"server_url": "http://localhost:4000", | |
"webui_enabled": true | |
}, | |
"run_list": [ "recipe[chef::bootstrap_server]" ] | |
} | |
EOF | |
chef-solo -c /etc/chef/solo.rb -j ~/chef.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz | |
# Open up server and web ui ports: | |
ufw allow 4000 | |
ufw allow 4040 | |
# Configure knife | |
# you may have permission problems on /etc/chef that you can chown to fix... | |
knife configure -i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Testing this fork adapted for Debian