sous-chefs / mysql

Development repository for the mysql cookbook
https://supermarket.chef.io/cookbooks/mysql
Apache License 2.0
338 stars 690 forks source link

Create and Start Without Package Install #505

Closed kjenney closed 4 years ago

kjenney commented 7 years ago

Cookbook version

8.0.4

Chef-client version

12.17.44

Platform Details

Centos 7.1.1503

Scenario:

Setup MySQL service without installing the MySQL package.

Steps to Reproduce:

I'm installing the most current MySQL package using yum_package before initializing mysql_service. My code block is in the exception below.

Expected Result:

I'm expecting the MySQL service to be setup using the parameters I have specified without attempting to install the package (as it's already been installed).

Actual Result:

The client run fails to run and gives the following exception:

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/my-mysql/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `package_action' for MysqlCookbook::MysqlService

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/my-mysql/recipes/default.rb:69:in `block in from_file'
  /var/chef/cache/cookbooks/my-mysql/recipes/default.rb:68:in `from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/my-mysql/recipes/default.rb:

65:  
66:  
67:  
68:  mysql_service mysql_service_name do
69>>   package_action :nothing
70:    bind_address node['mysql']['bind_address']
71:    port node['mysql']['port']
72:    data_dir node['mysql']['data_dir']
73:    initial_root_password mysql_root_password
74:    action [:create, :start]
75:  end
76:  
77:  mysql_config mysql_service_name do
78:    instance mysql_service_name

Platform:
---------
x86_64-linux
cheeseplus commented 7 years ago

It looks like package_action was ripped out during the converting the LWRP to a Custom Resource. As such the cookbook doesn't support the ability to do so anymore. At the very least we need to correct the docs here and see if this is something we want to support.

zmaupin commented 5 years ago

I've PRed removing that option from the docs. The package action depends on the mysql_service actions. If you're deleting a service, the package action is :remove. If you're installing, the package action is :install.

github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

github-actions[bot] commented 4 years ago

Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.