puppetlabs-mysql
puppetlabs-mysql copied to clipboard
Ensure fact mysql_version exist when granting privileges to xtrabacku…
…p user in MySQL 8.0
Summary
PR should allow setting up xtrabackup configuration without breaking initial puppet run as mysql_version fact is not available in the catalog.
Additional Context
Add any additional context about the problem here.
- [ ] Root cause and the steps to reproduce. (If applicable)
- [ ] Thought process behind the implementation.
Related Issues (if any)
PR should fixed the issue reported https://github.com/puppetlabs/puppetlabs-mysql/issues/1576
Checklist
- [ ] 🟢 Spec tests.
- [ ] 🟢 Acceptance tests.
- [ ] Manually verified. (For example
puppet apply
) Reproduced issue [root@localhost production]# puppet apply -e 'include profile::mariadb'
Warning: Module 'profile': Value returned from data_hash function 'yaml_data', when using location '/etc/puppetlabs/code/environments/production/modules/profile/data/common.yaml', must use keys qualified with the name of the module
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) on node localhost.localdomain
with fix applied
Notice: Compiled catalog for localhost.localdomain in environment production in 0.31 seconds
Notice: /Stage[main]/Profile::Mariadb/Package[mysql]/ensure: created
Notice: /Stage[main]/Profile::Mariadb/Package[mariadb]/ensure: created
Notice: /Stage[main]/Mysql::Server::Config/File[/etc/my.cnf.d]/ensure: created
Notice: /Stage[main]/Mysql::Server::Config/File[mysql-config-file]/ensure: defined content as '{sha256}e44307efdb246c98f0320b6f34b3cfc3931b25e3b6fa2f337b6b3ace65825567'
Notice: /Stage[main]/Mysql::Server::Install/Package[mysql-server]/ensure: created
in next puppet run backup configs will be applied.