Skip to content

Commit

Permalink
Reolse puppetlabs#1580: support mariadb 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
OxCom committed Apr 9, 2024
1 parent 38fad75 commit 941427a
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions lib/puppet/provider/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,29 @@ class Puppet::Provider::Mysql < Puppet::Provider
].join(':')

# rubocop:disable Style/HashSyntax
commands :mysql_raw => 'mysql'
commands :mysqld => 'mysqld'
commands :mysqladmin => 'mysqladmin'
commands :mysql_client => 'mysql'
commands :mariadb_client => 'mariadb'
commands :mysqld_service => 'mysqld'
commands :mariadbd_service => 'mariadbd'
commands :mysql_admin => 'mysqladmin'
commands :mariadb_admin => 'mysqladmin'
# rubocop:enable Style/HashSyntax

def self.mysql_raw(*args)
mysqld_version_string.scan(%r{mariadb}i) { return mariadb_client(*args) }
mysql_client(*args)
end

def self.mysqld(*args)
mysqld_version_string.scan(%r{mariadb}i) { return mariadbd_service(*args) }
mysqld_service(*args)
end

def self.mysqladmin(*args)
mysqld_version_string.scan(%r{mariadb}i) { return mariadb_admin(*args) }
mysql_admin(*args)
end

# Optional defaults file
def self.defaults_file
"--defaults-extra-file=#{Facter.value(:root_home)}/.my.cnf" if File.file?("#{Facter.value(:root_home)}/.my.cnf")
Expand Down

0 comments on commit 941427a

Please sign in to comment.