Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8211047
Remove labeller.yml
rajat-puppet Jul 22, 2024
b380c2a
Merge pull request
malikparvez Jul 22, 2024
5ef64e6
Fix spec unit for mysql_server_id
Marc-DRI Aug 28, 2024
118f33b
Fix mysql_users failing for SLES
rahuls2997 Sep 18, 2024
e11ed5b
Merge pull request #1649 from puppetlabs/CAT-2033
bastelfreak Sep 20, 2024
ed18548
Merge pull request #1646 from DRI-Syloe/fix_mysql_server_id_tu
Ramesh7 Oct 1, 2024
7d90921
Fix backup/rotation with multiple excluded databases
BuJo Dec 11, 2023
6ffe520
Merge pull request #1610 from synyx/backup-fix-excluded-dbs
bastelfreak Oct 1, 2024
020fdea
pdksync - (PF-3525) - pdk update for module
amitkarsale Oct 1, 2024
be2a27c
Merge pull request #1647 from puppetlabs/PF-3525-pdk-sync
malikparvez Oct 15, 2024
074067a
(CAT-2100) Add Debian 12 support
shubhamshinde360 Oct 18, 2024
d8d2e16
Merge pull request #1653 from puppetlabs/CAT-2100-add-debian-12-support
shubhamshinde360 Oct 25, 2024
b6eee44
(CAT-2158) Upgrade rexml to address CVE-2024-49761
amitkarsale Nov 13, 2024
90036a9
Merge pull request
malikparvez Nov 19, 2024
9ec1080
Release prep v16.1.0
Dec 7, 2024
5b4b7e5
Merge pull request #1658 from puppetlabs/release-prep
malikparvez Dec 9, 2024
e98d4eb
Release prep v16.2.0
Dec 16, 2024
cbda780
Merge pull request #1661 from puppetlabs/release-prep
amitkarsale Dec 16, 2024
b086a07
Merge branch 'puppetlabs:main' into mysqlpustream
minorOffense Mar 19, 2025
48c7e73
debug: force mariadb
minorOffense Mar 19, 2025
6164cc5
debug: remove mysql
minorOffense Mar 24, 2025
f612f35
fix(commands): hardcode hardcoded commands to be the mariadb values
spotzero Mar 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ fixtures:
"provision": "https://github.com/puppetlabs/provision.git"
puppet_agent:
repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
ref: v4.13.0
ref: v4.21.0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Ubuntu-22.04-arm", "RedHat-9-arm"]'
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Debian-12-arm", "Ubuntu-22.04-arm", "RedHat-9-arm"]'
Acceptance:
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/labeller.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Ubuntu-22.04-arm", "RedHat-9-arm"]'
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Debian-12-arm", "Ubuntu-22.04-arm", "RedHat-9-arm"]'
Acceptance:
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Publish module"

on:
workflow_dispatch:

jobs:
release:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
/spec/fixtures/modules/*
/tmp/
/vendor/
/.vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
.resource_types
.modules
.task_cache.json
.plan_cache.json
.rerun.json
bolt-debug.log
7 changes: 7 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@
/spec/fixtures/modules/*
/tmp/
/vendor/
/.vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
.resource_types
.modules
.task_cache.json
.plan_cache.json
.rerun.json
bolt-debug.log
/.fixtures.yml
/Gemfile
/.gitattributes
Expand Down
9 changes: 7 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
inherit_from: .rubocop_todo.yml

require:
- rubocop-performance
- rubocop-rspec
AllCops:
NewCops: enable
DisplayCopNames: true
TargetRubyVersion: '2.7'
TargetRubyVersion: '2.6'
Include:
- "**/*.rb"
Exclude:
Expand Down Expand Up @@ -530,6 +529,8 @@ Lint/DuplicateBranch:
Enabled: false
Lint/DuplicateMagicComment:
Enabled: false
Lint/DuplicateMatchPattern:
Enabled: false
Lint/DuplicateRegexpCharacterClassElement:
Enabled: false
Lint/EmptyBlock:
Expand Down Expand Up @@ -646,6 +647,8 @@ Style/ComparableClamp:
Enabled: false
Style/ConcatArrayLiterals:
Enabled: false
Style/DataInheritance:
Enabled: false
Style/DirEmpty:
Enabled: false
Style/DocumentDynamicEvalDefinition:
Expand Down Expand Up @@ -714,6 +717,8 @@ Style/RedundantHeredocDelimiterQuotes:
Enabled: false
Style/RedundantInitialize:
Enabled: false
Style/RedundantLineContinuation:
Enabled: false
Style/RedundantSelfAssignmentBranch:
Enabled: false
Style/RedundantStringEscape:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recommendations": [
"puppet.puppet-vscode",
"rebornix.Ruby"
"Shopify.ruby-lsp"
]
}
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v16.2.0](https://github.com/puppetlabs/puppetlabs-mysql/tree/v16.2.0) - 2024-12-16

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mysql/compare/v16.1.0...v16.2.0)

## [v16.1.0](https://github.com/puppetlabs/puppetlabs-mysql/tree/v16.1.0) - 2024-12-09

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mysql/compare/v16.0.0...v16.1.0)

### Added

- (CAT-2100) Add Debian 12 support [#1653](https://github.com/puppetlabs/puppetlabs-mysql/pull/1653) ([shubhamshinde360](https://github.com/shubhamshinde360))

### Fixed

- (CAT-2158) Upgrade rexml to address CVE-2024-49761 [#1656](https://github.com/puppetlabs/puppetlabs-mysql/pull/1656) ([amitkarsale](https://github.com/amitkarsale))
- Fix backup/rotation with multiple excluded databases [#1610](https://github.com/puppetlabs/puppetlabs-mysql/pull/1610) ([BuJo](https://github.com/BuJo))

## [v16.0.0](https://github.com/puppetlabs/puppetlabs-mysql/tree/v16.0.0) - 2024-07-11

[Full Changelog](https://github.com/puppetlabs/puppetlabs-mysql/compare/v15.0.0...v16.0.0)
Expand Down Expand Up @@ -842,7 +859,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Fixed

- PR 654 was incorrectly using stdlib dirname [#677](https://github.com/puppetlabs/puppetlabs-mysql/pull/677) ([underscorgan](https://github.com/underscorgan))
- Fix bug in 578 [#671](https://github.com/puppetlabs/puppetlabs-mysql/pull/671) ([aldavud](https://github.com/aldavud))
- Fix bug in 578 [#671](https://github.com/puppetlabs/puppetlabs-mysql/pull/671) ([](https://github.com/))
- Check for full path for log-bin to stop puppet from managing directory “." [#654](https://github.com/puppetlabs/puppetlabs-mysql/pull/654) ([NoodlesNZ](https://github.com/NoodlesNZ))

## [3.2.0](https://github.com/puppetlabs/puppetlabs-mysql/tree/3.2.0) - 2015-02-10
Expand Down
28 changes: 14 additions & 14 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ group :development do
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "deep_merge", '~> 1.2.2', require: false
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
gem "facterdb", '~> 1.18', require: false
gem "metadata-json-lint", '~> 3.0', require: false
gem "puppetlabs_spec_helper", '~> 6.0', require: false
gem "rspec-puppet-facts", '~> 2.0', require: false
gem "codecov", '~> 0.2', require: false
gem "facterdb", '~> 2.1', require: false
gem "metadata-json-lint", '~> 4.0', require: false
gem "rspec-puppet-facts", '~> 4.0', require: false
gem "dependency_checker", '~> 1.0.0', require: false
gem "parallel_tests", '= 3.12.1', require: false
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.5', require: false
gem "simplecov-console", '~> 0.9', require: false
gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '= 1.48.1', require: false
gem "rubocop", '~> 1.50.0', require: false
gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 2.19.0', require: false
gem "puppet-strings", '~> 4.0', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "rexml", '>= 3.3.9', require: false
end
group :system_tests do
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
end
group :release_prep do
group :development, :release_prep do
gem "puppet-strings", '~> 4.0', require: false
gem "puppetlabs_spec_helper", '~> 6.0', require: false
gem "puppetlabs_spec_helper", '~> 7.0', require: false
end
group :system_tests do
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
24 changes: 6 additions & 18 deletions lib/puppet/provider/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,17 @@ class Puppet::Provider::Mysql < Puppet::Provider
].join(':')

# rubocop:disable Style/HashSyntax
commands :mysql_client => 'mysql'
commands :mysql_client => 'mariadb'
commands :mariadb_client => 'mariadb'
commands :mysqld_service => 'mysqld'
commands :mysqld_service => 'mariadbd'
commands :mariadbd_service => 'mariadbd'
commands :mysql_admin => 'mysqladmin'
commands :mysql_admin => 'mariadbadmin'
commands :mariadb_admin => 'mariadb-admin'
commands :mysql_raw => 'mariadb'
commands :mysqld => 'mariadbd'
commands :mysqladmin => 'mariadbadmin'
# 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
2 changes: 1 addition & 1 deletion lib/puppet/provider/mysql_database/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Puppet::Type.type(:mysql_database).provide(:mysql, parent: Puppet::Provider::Mysql) do
desc 'Manages MySQL databases.'

commands mysql_raw: 'mysql'
commands mysql_raw: 'mariadb'

def self.instances
mysql_caller('show databases', 'regular').split("\n").map do |name|
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mysql_datadir/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'/usr/mysql/5.7/bin',
].join(':')

commands mysqld: 'mysqld'
commands mysqld: 'mariadbd'
optional_commands mysql_install_db: 'mysql_install_db'
# rubocop:disable Lint/UselessAssignment
def create
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mysql_grant/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Puppet::Type.type(:mysql_grant).provide(:mysql, parent: Puppet::Provider::Mysql) do
desc 'Set grants for users in MySQL.'

commands mysql_raw: 'mysql'
commands mysql_raw: 'mariadb'

def self.instances
instance_configs = {}
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mysql_plugin/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Puppet::Type.type(:mysql_plugin).provide(:mysql, parent: Puppet::Provider::Mysql) do
desc 'Manages MySQL plugins.'

commands mysql_raw: 'mysql'
commands mysql_raw: 'mariadb'

def self.instances
mysql_caller('show plugins', 'regular').split("\n").map do |line|
Expand Down
5 changes: 3 additions & 2 deletions lib/puppet/provider/mysql_user/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'mysql'))
Puppet::Type.type(:mysql_user).provide(:mysql, parent: Puppet::Provider::Mysql) do
desc 'manage users for a mysql database.'
commands mysql_raw: 'mysql'
commands mysql_raw: 'mariadb'

# Build a property_hash containing all the discovered information about MySQL
# users.
def self.instances
users = mysql_caller("SELECT CONCAT(User, '@',Host) AS User FROM mysql.user", 'regular').split("\n")
users = mysql_caller("SELECT CONCAT(User, '@',Host) AS User FROM mysql.user where HOST IS NOT NULL AND HOST != ''", 'regular').split("\n")
# users = users_full.reject { |user| user == 'PUBLIC@' }
# To reduce the number of calls to MySQL we collect all the properties in
# one big swoop.
users.map do |name|
Expand Down
2 changes: 1 addition & 1 deletion manifests/backup/xtrabackup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
}
}
else {
if $facts['os']['family'] == 'debian' and $facts['os']['release']['major'] == '11' or
if ($facts['os']['name'] == 'debian' and versioncmp($facts['os']['release']['major'], '11') >= 0) or
($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '22.04') >= 0) {
mysql_grant { "${backupuser}@localhost/*.*":
ensure => $ensure,
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
}
default: {
$provider = 'mysql'
$provider = 'mariadb'
}
}

Expand Down Expand Up @@ -217,6 +217,7 @@
'9' => 'ruby-mysql2', # stretch
'10' => 'ruby-mysql2', # buster
'11' => 'ruby-mysql2', # bullseye
'12' => 'ruby-mysql2', # bookworm
'16.04' => 'ruby-mysql', # xenial
'18.04' => 'ruby-mysql2', # bionic
'20.04' => 'ruby-mysql2', # focal
Expand Down
7 changes: 7 additions & 0 deletions manifests/server/installdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$basedir = $mysql::server::_options['mysqld']['basedir']
$config_file = $mysql::server::config_file
$log_error = $mysql::server::_options['mysqld']['log-error']
$log_dir = '/var/log/mysql'

if $mysql::server::manage_config_file and $config_file != $mysql::params::config_file {
$_config_file=$config_file
Expand All @@ -30,6 +31,12 @@
}
}

file { $log_dir:
ensure => 'directory',
owner => $mysqluser,
group => $mysql::server::mysql_group,
}

mysql_datadir { $datadir:
ensure => 'present',
datadir => $datadir,
Expand Down
9 changes: 5 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-mysql",
"version": "16.0.0",
"version": "16.2.0",
"author": "puppetlabs",
"summary": "Installs, configures, and manages the MySQL service.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -39,7 +39,8 @@
"operatingsystem": "Debian",
"operatingsystemrelease": [
"10",
"11"
"11",
"12"
]
},
{
Expand Down Expand Up @@ -84,6 +85,6 @@
],
"description": "MySQL module",
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
"template-ref": "heads/main-0-g79a2f93",
"pdk-version": "3.0.0"
"template-ref": "tags/3.2.0.4-0-g5d17ec1",
"pdk-version": "3.2.0"
}
Loading