diff --git a/manifests/backup/xtrabackup.pp b/manifests/backup/xtrabackup.pp index c73831f38..e6968cefc 100644 --- a/manifests/backup/xtrabackup.pp +++ b/manifests/backup/xtrabackup.pp @@ -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) @@ -50,7 +51,7 @@ 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/*.*":