Created
March 7, 2011 03:51
-
-
Save nathany/858040 to your computer and use it in GitHub Desktop.
Vagrant deploy.rb for Sprinkle using Capistrano delivery method
This file contains 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
set :user, 'vagrant' | |
set :run_method, :sudo | |
role :app, '33.33.33.10' | |
ssh_options[:keys] = `vagrant ssh_config | grep IdentityFile`.split.last |
This file contains 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
package :rvm do | |
description 'Ruby Version Manager' | |
runner ['curl -LsS http://bit.ly/rvm-install-system-wide > rvm-install-system-wide', 'bash < ./rvm-install-system-wide'] do | |
post :install, "usermod -a -G rvm vagrant" # Capistrano fetch(:user) ? | |
end | |
push_text "[[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm'", "~/.profile" | |
requires :rvm_dependencies | |
verify do | |
has_executable 'rvm' | |
end | |
end | |
package :rvm_dependencies do | |
description 'Ruby Version Manager dependencies' | |
apt %w(curl bison git-core) | |
end | |
package :ree, :provides => :ruby do | |
description 'Ruby Enterprise Edition' | |
version '1.8.7' | |
push_text '--silent --show-error', '~/.curlrc' # want no progress bar! | |
runner "rvm install ree-#{version}" do | |
post :install, "rvm ree-#{version} --default" | |
end | |
requires :rvm, :ree_dependencies | |
verify do | |
has_executable_with_version 'ruby', 'Ruby Enterprise Edition' | |
end | |
end | |
package :ree_dependencies do | |
description 'Ruby Enterprise Edition dependencies' | |
apt %w(build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev) | |
end | |
policy :vagrant, :roles => :app do | |
requires :ruby | |
end | |
deployment do | |
delivery :capistrano | |
source do | |
prefix '/usr/local' | |
archives '/usr/local/sources' | |
builds '/usr/local/build' | |
end | |
end |
This Sprinkle install recipe isn't actually working yet. :-(
You might need a chomp on the ssh_options[:keys]
. I ended up going with:
ssh_options[:keys] = `vagrant ssh_config | grep IdentityFile | awk '{print $2}'`.chomp
i do not know in which version of vagrant it changed but here with 1.0.0 i need to change ssh_config to ssh-config for it to work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sprinkle kept prompting me for a password, despite having the IdentityFile specified in my ~/.ssh/config. Specifying it in deploy.rb does the trick.