2

I'm using chef for the first time, trying to get my head around recipes and cookbooks.

I receiving the error 'mysql::client' fails after configuring the standard php cookbook which I'm currently doing in my roles file:

run_list(
  "recipe[phpwebtatics]",
  "recipe[php]",
  "recipe[composer]"
)

override_attributes 'php' => {
'install_method' => "source",
'version' => "5.5",
'packages' => ["php55w", "php55w-devel", "php55w-pear", "php55w-cli", "php55w-pdo", "php55w-fpm", "php55w-intl", "php55w-mbstring", "php55w-mcrypt", "php55w-pecl-memcache", "php55w-pecl-xdebug", "php55w-process", "php55w-xml"]
}

(I've written my own webtatics cookbook which basically fetches the webtatics rpm):

# Go get web tatic
remote_file "#{Chef::Config[:file_cache_path]}/webtatic_repo_latest.rpm" do
    source "http://mirror.webtatic.com/yum/el6/latest.rpm"
    action :create
end

rpm_package "jmxtrans" do
    source "#{Chef::Config[:file_cache_path]}/webtatic_repo_latest.rpm"
    action :install
end 

I've tracked the error to the line:

include_recipe 'mysql::client' if configure_options =~ /mysql/

in the php cookbook, but I have no idea how to disable it from running and I can't simply replace the line as it comes from Berkshelf and get's overwritten.

Apparently mysql:client is no longer a valid way of installing mysql so I'm not sure why it's there. Is this a bug or can I override this?

Thanks

Darren
  • 173
  • 1
  • 10

1 Answers1

4

As of version 6.0.0 the mysql cookbook is now a library-only cookbook. This means it no longer provides recipes. You'll want to create a wrapper cookbook that uses the mysql_client resource and use that recipe instead.

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • Thanks coderanger - but I don't even really need mysql, the line I referenced is included in the php 'source' recipe. Is there a way to disable this line from running? or should a change be made to the public php cookbook? – Darren Jan 16 '15 at 10:30
  • 1
    The php cookbook is out of date. If you revert the mysql cookbook to the final 5.x version, it should work again. – coderanger Jan 16 '15 at 17:28
  • Thanks coderanger - it's what I thought - just wasn't sure as I'm new to chef and the php cookbook seemed a reasonably popular cookbook. – Darren Jan 16 '15 at 17:31
  • Please don't comment on answers from many years ago. Open a new question instead. – coderanger Mar 20 '18 at 19:37