Permalink
Browse files

Do not install ruby if it is already installed.

  • Loading branch information...
1 parent 857c528 commit 63c4fd6c31fd9d3063949d577f91ead3f0bb7007 @iafonov committed Jul 13, 2012
Showing with 22 additions and 2 deletions.
  1. +5 −1 .chef/bootstrap/server_ubuntu_1_9_3.erb
  2. +2 −1 README.md
  3. +15 −0 Rakefile
View
6 .chef/bootstrap/server_ubuntu_1_9_3.erb
@@ -6,6 +6,11 @@ export DEBIAN_FRONTEND=noninteractive
set -x
install_1_9_3() {
+ if ruby -v | grep -q "1.9.3p194" >/dev/null ; then
+ printf "Ruby 1.9.3 is already installed skipping...\n"
+ return
+ fi
+
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
@@ -80,7 +85,6 @@ install_1_9_3
set_hostname_for_ubuntu
add_opscode_apt_repo
install_chef_server
-enable_ssl_proxy
printf -- "-----> Bootstraping Chef Server on ${hostname} is complete.\n"
View
3 README.md
@@ -226,7 +226,8 @@ client_key 'client.pem' # your client key
* Navigate to http://li483-124.members.linode.com - you should see copycopter welcome screen.
-### Contributors:
+## Contributors:
+
* [Dmitriy Kiriyenko](https://github.com/dmitriy-kiriyenko)
© 2012 [Igor Afonov](https://iafonov.github.com) MIT License
View
15 Rakefile
@@ -22,3 +22,18 @@ namespace :deploy do
system('./bin/knife cookbook upload -a')
end
end
+
+namespace :test do
+ task :self_bootstrap do
+ system("bundle install --binstubs")
+ system <<-EOS
+ rm -rf ~/.ssh
+ ssh-keygen -t rsa -N "" -f ~/.ssh/identity
+ cat ~/.ssh/identity.pub > ~/.ssh/authorized_keys
+ printf "Host *\n StrictHostKeyChecking no" > ~/.ssh/config
+ ssh-add ~/.ssh/identity
+ EOS
+
+ system("./bin/knife bootstrap localhost --ssh-user #{ENV['USER']} --distro server_ubuntu_1_9_3 --node-name 'chef.localhost' --sudo")
+ end
+end

0 comments on commit 63c4fd6

Please sign in to comment.