Skip to content

Commit bd606f9

Browse files
committed
xtrabackup: handle missing facts gracefully
1 parent f51fabd commit bd606f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manifests/backup/xtrabackup.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
require => Class['mysql::server::root_password'],
5151
}
5252
# Percona XtraBackup needs additional grants/privileges to work with MySQL 8
53-
if versioncmp($facts['mysql_version'], '8') >= 0 and !(/(?i:mariadb)/ in $facts['mysqld_version']) {
53+
if ('mysql_version' in $facts) and ('mysqld_version' in $facts) and versioncmp($facts['mysql_version'], '8') >= 0 and !(/(?i:mariadb)/ in $facts['mysqld_version']) {
5454
if ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') >= 0) or
5555
($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '22.04') >= 0) {
5656
mysql_grant { "${backupuser}@localhost/*.*":

0 commit comments

Comments
 (0)