-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.rb
43 lines (34 loc) · 1.24 KB
/
bootstrap.rb
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
#!/usr/bin/env ruby
CHEF_550 = true # Until CHEF-550 is merged into master
def cmd(cmd)
puts cmd; system(cmd)
end
puts '-' * 80
puts "Chef bootstrap"
puts
cmd "aptitude -y update"
cmd "apt-get -y install git-core"
cmd "aptitude -y install irb ri rdoc libshadow-ruby1.8 ruby1.8-dev gcc g++ curl"
cmd "curl -L 'http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz' | tar xvzf -"
cmd "cd rubygems* && ruby setup.rb --no-ri --no-rdoc"
cmd "ln -sfv /usr/bin/gem1.8 /usr/bin/gem"
cmd "gem install rdoc chef ohai aws-s3 --no-ri --no-rdoc --source http://gems.opscode.com --source http://gems.rubyforge.org"
if CHEF_550
cmd %q{sed -i 's/Chef::Config\[:file_cache_path\]/::File.expand_path(Chef::Config\[:file_cache_path\])/' /usr/lib/ruby/gems/1.8/gems/chef-0.7.10/lib/chef/provider/template.rb}
end
# opscode cookbooks
cmd "git clone git://github.com/opscode/cookbooks.git"
# disable postgresql ssl for the moment
cmd "sed -i 's/ssl = true/ssl = false/' cookbooks/postgresql/templates/default/postgresql.conf.erb"
# cmd "yes | mkfs -t ext3 /dev/sdq1"
# cmd "yes | mkfs -t ext3 /dev/sdq2"
version = system('gem -v')
unless version
puts '*' * 80
puts '**** ERROR: MISSING RUBYGEMS'
puts '*' * 80
else
puts '-' * 80
puts "Done!"
puts '-' * 80
end