Skip to content

Commit

Permalink
trying to fix first run using explicit param is_mysql_v8
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelic0 committed Aug 31, 2023
1 parent b16c9b9 commit 3a3c69e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions manifests/backup/xtrabackup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
Optional[String[1]] $compression_command = undef,
Optional[String[1]] $compression_extension = undef,
String[1] $backupmethod_package = $mysql::params::xtrabackup_package_name,
Array[String] $excludedatabases = [],
Array[String] $excludedatabases = [],
Boolean $is_mysql_v8 = false,
) inherits mysql::params {
stdlib::ensure_packages($backupmethod_package)

Expand All @@ -43,14 +44,14 @@
$backuppassword
}

if (defined('$facts["mysql_version"]')) and $backupuser and $backuppassword {
if $backupuser and $backuppassword {
mysql_user { "${backupuser}@localhost":
ensure => $ensure,
password_hash => Deferred('mysql::password', [$backuppassword]),
require => Class['mysql::server::root_password'],
}
# Percona XtraBackup needs additional grants/privileges to work with MySQL 8
if versioncmp($facts['mysql_version'], '8') >= 0 and !(/(?i:mariadb)/ in $facts['mysqld_version']) {
if ($is_mysql_v8 or versioncmp($facts['mysql_version'], '8') >= 0) and !(/(?i:mariadb)/ in $facts['mysqld_version']) {
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/*.*":
Expand Down

0 comments on commit 3a3c69e

Please sign in to comment.