puppetlabs / puppetlabs-mysql

MySQL Puppet Module / Manifests + Types & Providers
Apache License 2.0
380 stars 792 forks source link

xtrabackup #1576

Open ubellavance opened 1 year ago

ubellavance commented 1 year ago

Describe the Bug

Error when running puppet with an xtrabackup config created. Error: Evaluation Error: Error while evaluating a Function Call, 'versioncmp' parameter 'a' expects a String value, got Undef (file: /etc/puppetlabs/code/environments/production/modules/mysql/manifests/backup/xtrabackup.pp, line: 53, column: 8)

Expected Behavior

puppet apply should run w/o error

Steps to Reproduce

Steps to reproduce the behavior:

  1. Manifest to get configuration from hiera:
    
    # Create backup configuration in Hiera
    if $mysql_backup_config {
    # Using create_resources
    # create_resources('class', $mysql_backup_config, {})
    # or
    # using each(preferable)
    $mysql_backup_config.each |$backup_class,$backup_config| {
      class { $backup_class:
        * => $backup_config,
      }
    }
    }
2. Hiera configuration :

profile::mariadb::mysql_backup_config: 'mysql::backup::xtrabackup': backupuser: 'backupuser' backuppassword: 'blabla' backupmethod: 'mariabackup' backupmethod_package: 'mariadb-backup' backupdir: '/var/backups/mysql/' backuprotate: 7 execpath: '/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin' time: [ '23' , '15' ]



## Environment
 - Puppet 7.25
 - RHEL8

## Additional Context
If I remove the xtrabackup config above, puppet runs OK.  Once MariaDB is installed, I can re-instate my xtrabackup config and it runs OK.