Skip to content

Respect ensure when managing xtrabackup backup package#1716

Open
milad-zanganeh wants to merge 3 commits into
puppetlabs:mainfrom
milad-zanganeh:fix/xtrabackup-package-ensure-absent
Open

Respect ensure when managing xtrabackup backup package#1716
milad-zanganeh wants to merge 3 commits into
puppetlabs:mainfrom
milad-zanganeh:fix/xtrabackup-package-ensure-absent

Conversation

@milad-zanganeh

@milad-zanganeh milad-zanganeh commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Fixes mysql::backup::xtrabackup so that the backup method package and backup directory are removed when the class is declared with ensure => absent.

Additional Context

  • Root cause and the steps to reproduce.
    • Root cause: stdlib::ensure_packages($backupmethod_package) was called without an options hash, defaulting the package to ensure => present regardless of the class $ensure parameter.
    • The $backupdir file resource was hardcoded to ensure => 'directory', which ignores the class's $ensure parameter.
    • Reproduce: Declare mysql::server::backup (with backupmethod => 'xtrabackup') and ensure => absent, run puppet apply, and observe that the backup method package remains installed and still manages the backup directory.
  • Thought process behind the implementation.
    • The class already exposes an $ensure parameter (Enum['present', 'absent']) used for the other backup resources. Passing it through to stdlib::ensure_packages and file makes the package and directory lifecycle consistent with the rest of the backup resources without introducing a new parameter.

@milad-zanganeh milad-zanganeh force-pushed the fix/xtrabackup-package-ensure-absent branch from ec182a5 to 408b56a Compare July 9, 2026 14:31
@CLAassistant

CLAassistant commented Jul 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@milad-zanganeh milad-zanganeh force-pushed the fix/xtrabackup-package-ensure-absent branch from 408b56a to 51fc626 Compare July 9, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants