monad (owner)

Fork Of

Revisions

gist: 163963 Download_button fork
public
Public Clone URL: git://gist.github.com/163963.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/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