Closed jayhendren closed 7 years ago
With the switch to the new-style LWRPs in https://github.com/sinfomicien/mysql2_chef_gem/pull/38, the following snippet from the README no longer works:
Providers Chef selects a default provider based on platform and version, but you can specify one if your platform support it. mysql2_chef_gem 'default' do provider Chef::Provider::Mysql2ChefGem::Mariadb action :install end
Providers
Chef selects a default provider based on platform and version, but you can specify one if your platform support it.
mysql2_chef_gem 'default' do provider Chef::Provider::Mysql2ChefGem::Mariadb action :install end
Attempting to do this results in:
================================================================================ Recipe Compile Error in /tmp/kitchen/cache/cookbooks/my_policy/recipes/default.rb ================================================================================ NameError --------- uninitialized constant Chef::Provider::Mysql2ChefGem Cookbook Trace: --------------- /tmp/kitchen/cache/cookbooks/cub_mariadb/recipes/default.rb:72:in `block in from_file' /tmp/kitchen/cache/cookbooks/cub_mariadb/recipes/default.rb:71:in `from_file' /tmp/kitchen/cache/cookbooks/cub_lamp/recipes/default.rb:1:in `from_file' /tmp/kitchen/cache/cookbooks/my_policy/recipes/default.rb:2:in `from_file' Relevant File Content: ---------------------- /tmp/kitchen/cache/cookbooks/cub_mariadb/recipes/default.rb: 65: directory 'mydatadir' do 66: path node['mariadb']['mysqld']['datadir'] 67: mode '0755' 68: end 69: 70: # Required addition in order for the database cookbook to talk to mariadb. 71: mysql2_chef_gem 'default' do 72>> provider Chef::Provider::Mysql2ChefGem::Mariadb 73: action :install 74: end 75: 76: mysql_connection_info = { 77: host: 'localhost', 78: username: node['mariadb']['server_root_user'], 79: password: node['mariadb']['server_root_password'], 80: } 81: Platform: --------- x86_64-linux
I just released 2.0.1 with additional updates to the readme to note the changes and include the correct format in the example. Thanks for the report
With the switch to the new-style LWRPs in https://github.com/sinfomicien/mysql2_chef_gem/pull/38, the following snippet from the README no longer works:
Attempting to do this results in: