From 2dcbb9bb12317cf5012d7e732b13b53c97efe77d Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Sun, 13 Feb 2011 01:09:33 +0100 Subject: [PATCH] Moved MySQL-recipe to own file and start/stop the service to create the MySQL-system-tables (this should finally fix mysql-recipe) --- chef/cookbooks/centos/recipes/bootstrap.rb | 3 --- chef/cookbooks/centos/recipes/main.rb | 1 + chef/cookbooks/centos/recipes/mysql.rb | 11 +++++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 chef/cookbooks/centos/recipes/mysql.rb diff --git a/chef/cookbooks/centos/recipes/bootstrap.rb b/chef/cookbooks/centos/recipes/bootstrap.rb index 3e6c61017..0458df3fa 100644 --- a/chef/cookbooks/centos/recipes/bootstrap.rb +++ b/chef/cookbooks/centos/recipes/bootstrap.rb @@ -19,9 +19,6 @@ end execute "rvm deps" do command "yum install -y bzip2" end -execute "install mysql" do - command "yum install -y mysql mysql-server mysql-devel" -end def harden_ruby(ruby_string) Dir.glob("/usr/local/rvm/wrappers/#{ruby_string}/*").each do |file| diff --git a/chef/cookbooks/centos/recipes/main.rb b/chef/cookbooks/centos/recipes/main.rb index f23ed9ac6..f5455876a 100644 --- a/chef/cookbooks/centos/recipes/main.rb +++ b/chef/cookbooks/centos/recipes/main.rb @@ -15,6 +15,7 @@ end harden_ruby("ree-1.8.7-2010.02") include_recipe "centos::image_magick" +include_recipe "centos::mysql" include_recipe "common::main" include_recipe "centos::nginx" include_recipe "centos::redis" diff --git a/chef/cookbooks/centos/recipes/mysql.rb b/chef/cookbooks/centos/recipes/mysql.rb new file mode 100644 index 000000000..184f4932e --- /dev/null +++ b/chef/cookbooks/centos/recipes/mysql.rb @@ -0,0 +1,11 @@ +execute "install mysql" do + command "yum install -y mysql mysql-server mysql-devel" +end + +execute "start mysql service to create the system tables" do + command "service mysqld start" +end + +execute "stop service again" do + command "service mysqld stop" +end