Sha256: 2673684e9dfca07bcd588070c658a1c123b16786168b68cbc21e2138c882ca9a

Contents?: true

Size: 832 Bytes

Versions: 3

Compression:

Stored size: 832 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._\n    
    <pre>set :mysql_admin_password_set, prompt.password('Mysql admin password (to set): ')</pre>\n      
    DESC
    task :install do    
      
      # Settings
      fetch_or_default(:mysql_admin_password_set, prompt.password('Mysql admin password (to set): ', true))

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capitate-0.2.1 lib/recipes/centos/mysql.rb
capitate-0.2.2 lib/recipes/centos/mysql.rb
capitate-0.2.3 lib/recipes/centos/mysql.rb