It took me a few hours to get my first chef server up and running.
(I found the wiki to be quite confusing. Fewer links and a diagram would have helped.)
This is what I did for ubuntu 9.10. Even then I had to contend with the 'lost admin password' a couple of times.
I'm in a pretty happy place now, with server, client and knife working.... trying to get to grips with the cookbooks now... apache2 openid doesn't seem to work for me.
John
logfile="/root/log.txt"
echo "-----" >> $logfile
# New sources.list
cat > /etc/apt/sources.list << EOF
deb http://gb.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ karmic main restricted
deb http://gb.archive.ubuntu.com/ubuntu/ karmic-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ karmic-updates main restricted
deb http://gb.archive.ubuntu.com/ubuntu/ karmic universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ karmic universe
deb http://gb.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb http://gb.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb http://security.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted
deb http://security.ubuntu.com/ubuntu karmic-security universe
deb-src http://security.ubuntu.com/ubuntu karmic-security universe
deb http://security.ubuntu.com/ubuntu karmic-security multiverse
deb-src http://security.ubuntu.com/ubuntu karmic-security multiverse
EOF
# Update System
apt-get -y update
#installing ruby
apt-get -y install build-essential >> $logfile
apt-get -y install ruby >> $logfile
apt-get -y install ruby-dev >> $logfile
apt-get -y install libzlib-ruby >> $logfile
apt-get -y install libyaml-ruby >> $logfile
apt-get -y install libopenssl-ruby >> $logfile
apt-get -y install runit >> $logfile
#installing rubygems
wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
tar xzvf rubygems-1.3.6.tgz >> $logfile
cd rubygems-1.3.6
ruby setup.rb >> $logfile
ln -s /usr/bin/gem1.8 /usr/bin/gem
gem update --no-ri --no-rdoc --system >> $logfile
#SEE http://wiki.opscode.com/display/chef/Preparing+Debian+and+Ubuntu+for+RubyGems
apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert
gem install --no-ri --no-rdoc chef
#SEE http://wiki.opscode.com/display/chef/Bootstrap+Chef+RubyGems+Installation
cat > ~/solo.rb <<EOF
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
cat > ~/chef.json <<EOF
{
"bootstrap": {
"chef": {
"url_type": "http",
"init_style": "runit",
"path": "/srv/chef",
"serve_path": "/srv/chef",
"server_fqdn": "chef.reflectornetwork.com",
"webui_enabled": true
}
},
"run_list": [ "recipe[bootstrap::server]" ]
}
EOF
chef-solo -c ~/solo.rb -j ~/chef.json
--
Archive powered by MHonArc 2.6.16.