Skip to content

Instantly share code, notes, and snippets.

@bruno-
Created April 3, 2012 17:51
Show Gist options
  • Save bruno-/2294117 to your computer and use it in GitHub Desktop.
Save bruno-/2294117 to your computer and use it in GitHub Desktop.
Capistrano mysql interactive installation
desc "Install the latest stable release of MySql."
task :install, roles: :db, only: {primary: true} do
#run "echo #{mysql_password}"
run "#{sudo} apt-get -y update"
run "#{sudo} apt-get -y install mysql-server" do |channel, stream, data|
# prompts for mysql root password (when blue screen appears)
channel.send_data("#{mysql_root_password}\n\r") if data =~ /password/
end
run "#{sudo} apt-get -y install mysql-client libmysqlclient-dev"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment