Skip to content

Commit

Permalink
xtrabackup: handle missing facts gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed May 8, 2024
1 parent f51fabd commit bd606f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/backup/xtrabackup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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 ('mysql_version' in $facts) and ('mysqld_version' in $facts) and 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 bd606f9

Please sign in to comment.