edestecd / puppet-mariadb

Puppet Module for managing MariaDB
GNU General Public License v3.0
3 stars 21 forks source link

merge of tls_options parameter for mysql_user breaks mariadb module #2

Closed tobias-urdin closed 7 years ago

tobias-urdin commented 7 years ago

The recent merge of tls_options for mysql_user broke my setup

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: no parameter named 'tls_options' at /etc/puppetlabs/code/modules/mariadb/manifests/cluster/wsrep_sst_user.pp:13 on Mysql_user[wsrep_sst@%] at /etc/puppetlabs/code/modules/mariadb/manifests/cluster/wsrep_sst_user.pp:13 on node mariadb1

I have verified that I have the tls_options parameter for the mysql_user resource (the puppetlabs-mysql module, I sync the puppetlabs-mysql module against the github master branch and still spits out the same error).

Have I missed something? Thanks for any feedback.

edestecd commented 7 years ago

Sorry about that. What version of the mysql module are you using? The tls_options parameter was just recently added to puppetlabs/mysql on master. You will need to get the latest from mysql master or pin to the previous commit of mariadb.

I will fix this before I release a stable version to the forge. Thanks for pointing it out.

On Nov 9, 2016 6:10 AM, "Tobias Urdin" notifications@github.com wrote:

The recent merge of tls_options for mysql_user broke my setup

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: no parameter named 'tls_options' at /etc/puppetlabs/code/modules/mariadb/manifests/cluster/wsrep_sst_user.pp:13 on Mysql_user[wsrep_sst@%] at /etc/puppetlabs/code/modules/ mariadb/manifests/cluster/wsrep_sst_user.pp:13 on node mariadb1

I have verified that I have the tls_options parameter for the mysql_user resource (the puppetlabs-mysql module, I sync the puppetlabs-mysql module against the github master branch and still spits out the same error).

Have I missed something? Thanks for any feedback.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/edestecd/puppet-mariadb/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGjEVQ4cqnnAA0u-Ti6DjsEis8YiEO-ks5q8aoAgaJpZM4Ktasg .

edestecd commented 7 years ago

Hmm if you have the latest from master on the puppetlabs/mysql it should work. This is what we are doing and I successfully deployed it to our environment yesterday...

On Nov 9, 2016 6:10 AM, "Tobias Urdin" notifications@github.com wrote:

The recent merge of tls_options for mysql_user broke my setup

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: no parameter named 'tls_options' at /etc/puppetlabs/code/modules/mariadb/manifests/cluster/wsrep_sst_user.pp:13 on Mysql_user[wsrep_sst@%] at /etc/puppetlabs/code/modules/ mariadb/manifests/cluster/wsrep_sst_user.pp:13 on node mariadb1

I have verified that I have the tls_options parameter for the mysql_user resource (the puppetlabs-mysql module, I sync the puppetlabs-mysql module against the github master branch and still spits out the same error).

Have I missed something? Thanks for any feedback.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/edestecd/puppet-mariadb/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGjEVQ4cqnnAA0u-Ti6DjsEis8YiEO-ks5q8aoAgaJpZM4Ktasg .

tobias-urdin commented 7 years ago

The weird thing is that I have synced both puppet-mariadb and puppetlabs-mysql against master using librarian-puppet and a Puppetfile. Do you have any suggestions?

mod "puppetlabs-mysql", :git => "https://github.com/puppetlabs/puppetlabs-mysql.git", :ref => "master" mod "puppet-mariadb", :git => "https://github.com/edestecd/puppet-mariadb", :ref => "master"

root@puppetmaster:~/code/modules/mysql# grep -r "tls_options" * CHANGELOG.md:- Adds support for setting tls_options in mysql_user lib/puppet/provider/mysql_user/mysql.rb: @tls_options = parse_tls_options(ssl_type, ssl_cipher, x509_issuer, x509_subject) lib/puppet/provider/mysql_user/mysql.rb: :tls_options => @tls_options, lib/puppet/provider/mysql_user/mysql.rb: tls_options = @resource.value(:tls_options) || ['NONE'] lib/puppet/provider/mysql_user/mysql.rb: merged_tls_options = tls_options.join(' AND ') lib/puppet/provider/mysql_user/mysql.rb: mysql([defaults_file, system_database, '-e', "ALTER USER '#{merged_name}' REQUIRE #{merged_tls_options}"].compact) lib/puppet/provider/mysql_user/mysql.rb: mysql([defaults_file, systemdatabase, '-e', "GRANT USAGE ON ._ TO '#{merged_name}' REQUIRE #{merged_tls_options}"].compact) lib/puppet/provider/mysql_user/mysql.rb: @property_hash[:tls_options] = tls_options lib/puppet/provider/mysql_user/mysql.rb: def tls_options=(array) lib/puppet/provider/mysql_user/mysql.rb: merged_tls_options = array.join(' AND ') lib/puppet/provider/mysql_user/mysql.rb: mysql([defaults_file, system_database, '-e', "ALTER USER #{merged_name} REQUIRE #{merged_tls_options}"].compact) lib/puppet/provider/mysql_user/mysql.rb: mysql([defaults_file, systemdatabase, '-e', "GRANT USAGE ON ._ TO #{merged_name} REQUIRE #{merged_tls_options}"].compact) lib/puppet/provider/mysql_user/mysql.rb: tls_options == array ? (return true) : (return false) lib/puppet/provider/mysql_user/mysql.rb: def self.parse_tls_options(ssl_type, ssl_cipher, x509_issuer, x509_subject) lib/puppet/type/mysql_user.rb: newproperty(:tls_options, :array_matching => :all) do README.md: tls_options => ['NONE'], README.md: tls_options => ['SSL'], README.md:##### tls_options spec/acceptance/types/mysql_user_spec.rb: tls_options => ['SSL'], spec/acceptance/types/mysql_user_spec.rb: tls_options => ['X509'], spec/unit/puppet/provider/mysql_user/mysql_spec.rb: describe 'tls_options=' do spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.expects(:tls_options).returns(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.tls_options=(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.expects(:tls_options).returns(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.tls_options=(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.expects(:tls_options).returns(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.tls_options=(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.expects(:tls_options).returns(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.tls_options=(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.expects(:tls_options).returns(['NONE']) spec/unit/puppet/provider/mysql_user/mysql_spec.rb: provider.tls_options=(['NONE'])

edestecd commented 7 years ago

what is your modulepath? could you be pulling modules from somewhere else and be grabbing an old version of mysql?

puppet config print modulepath
edestecd commented 7 years ago

The error you are getting definitely seems like you are using an older version of mysql... I can't think of another reason for that error. That has always been the case for me in the past when I get an error about missing params that have been added in newer versions of modules...

tobias-urdin commented 7 years ago

Thanks for helping out, I restarted puppetserver and it started working. I assume it was a cached catalog causing the issue.

Also thanks for a great module, been using it for a while with great success :+1:

edestecd commented 7 years ago

Awesome! Glad your issue is resolved. I'm happy that sharing my work could make your life easier...