Created
April 27, 2010 05:31
-
-
Save davidlee/380360 to your computer and use it in GitHub Desktop.
#CHEF ubuntu 9.10 fresh install to registered client - just change the server address
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/sh | |
# set up FQDN | |
echo "you better have a hostname, or shit won't work!" | |
echo "and, we expect /etc/chef/validation.pem to exist and match the server" | |
sleep 1 | |
# install packages | |
apt-get install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert git-core | |
# install rubygems | |
cd /usr/local/src | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.tgz | |
tar xvzf rubygems-1.3.6.tgz | |
cd rubygems-1.3.6/ | |
ruby setup.rb | |
ln -s /usr/bin/gem1.8 /usr/bin/gem | |
gem install chef chef_knives | |
# configure client | |
cd ~/ | |
cat <<EOF > chef.json | |
{ | |
"bootstrap": { | |
"chef": { | |
"url_type": "http", | |
"init_style": "runit", | |
"path": "/srv/chef", | |
"serve_path": "/srv/chef", | |
"server_fqdn": "chef.incite.com" | |
} | |
}, | |
"run_list": [ "recipe[bootstrap::client]" ] | |
} | |
EOF | |
cat <<EOF > solo.rb | |
file_cache_path "/tmp/chef-solo" | |
cookbook_path "/tmp/chef-solo/cookbooks" | |
recipe_url "http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz" | |
EOF | |
# feeling lucky? | |
chef-solo -c ~/solo.rb -j ~/chef.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz | |
chef-client |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment