lib/recipes/centos/mysql.rb in capitate-0.1.9 vs lib/recipes/centos/mysql.rb in capitate-0.2.1
- old
+ new
@@ -3,29 +3,26 @@
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): ') }
-
+ *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,
- Proc.new { Capistrano::CLI.ui.ask('Mysql admin password (to set): ') })
+ 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
- sudo "/sbin/chkconfig --level 345 mysqld on"
- sudo "/sbin/service mysqld start"
+ run_via "/sbin/chkconfig --level 345 mysqld on"
+ run_via "/sbin/service mysqld start"
# Set admin password
- sudo "/usr/bin/mysqladmin -u root password #{mysql_admin_password_set}"
+ run_via "/usr/bin/mysqladmin -u root password #{mysql_admin_password_set}"
end
end
end
\ No newline at end of file