Skip to content

Added mysql::backup class. #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 11, 2012
Merged

Added mysql::backup class. #64

merged 4 commits into from
May 11, 2012

Conversation

razorsedge
Copy link
Contributor

Installs a mysql backup script, cronjob, and priviledged backup user.
Includes rspec tests and updated documentation.

Installs a mysql backup script, cronjob, and priviledged backup user. 
Includes rspec tests and updated documentation.
$backupdir = $mysql::params::backupdir
) {

if $backupuser == 'UNSET' or $backupdir == 'UNSET' or $backuppassword == 'UNSET' {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the backupuser/dir/password are required, why not just not supply parameter defaults?

class mysql::backup (
$backupuser,
$backuppassword,
$backupdir,
$ensure => present
) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that would be obvious and make total sense. :-) I guess I just needed a second pair of eyes. I was staring at the code last night thinking that something was not quite right....

No need for setting default values to class parameters and then testing
to confirm they are set to non-default values.  Simply do not give them
values to begin with.
}

database_grant { "${backupuser}@localhost":
privileges => [ 'select_priv', 'reload_priv', 'lock_tables_priv' ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The privileges are case-sensitive in current master. As far as I can tell, case-insensitive privileges should never have worked correctly. If you can confirm that these privileges used to work, I'll try to get case-insensitive privileges working in the new privilege system.

Otherwise, please fix your casing here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@branan can you be sure to update the provider so that privileges are case insensitive

@razorsedge
Copy link
Contributor Author

These worked before pull request #65, but I'll upcase the first char to comply with the new magic. :-) You may want to consider some documentation to go with #65 on how someone can figure out what privs are available to put in their manifests.

minute => 5,
require => File['mysqlbackup.sh'],
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make the frequency, time, and retention of backups more configurable? Perhaps make the cron time settings configurable and incorporate logrotate to make retention configurable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cboylan It is possible, but I was hoping to get this base module merged and then everyone can submit pull requests against it to make it even better.

bodepd added a commit that referenced this pull request May 11, 2012
Added mysql::backup class.
@bodepd bodepd merged commit 360f8d9 into puppetlabs:master May 11, 2012
pmcmaw pushed a commit to pmcmaw/puppetlabs-mysql that referenced this pull request Mar 3, 2021
(MODULES-8420) Release prep for 0.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants