Sha256: 00fc353435a4e2538aca71f555ea69be226e6f3b867ef0f93be58dd6ef32fa39

Contents?: true

Size: 857 Bytes

Versions: 2

Compression:

Stored size: 857 Bytes

Contents

namespace :mysql do
  
  namespace :centos do
    
    desc <<-DESC
    Install mysql.
    
    mysql_admin_password_set: Mysql admin password (to set). Defaults to password prompt.
    
      set :mysql_admin_password_set, Proc.new { Capistrano::CLI.ui.ask('Mysql admin password (to set): ') }
      
    DESC
    task :install do    
      
      # Settings
      fetch_or_default(:mysql_admin_password_set, 
        Proc.new { Capistrano::CLI.ui.ask('Mysql admin password (to set): ') })      

      # Install through package manager
      yum.install([ "mysql", "mysql-devel", "mysql-server" ])

      # Install service
      sudo "/sbin/chkconfig --level 345 mysqld on"
      sudo "/sbin/service mysqld start"
      
      # Set admin password
      sudo "/usr/bin/mysqladmin -u root password #{mysql_admin_password_set}"    
    end
    
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capitate-0.1.8 lib/recipes/centos/mysql.rb
capitate-0.1.9 lib/recipes/centos/mysql.rb