-
Notifications
You must be signed in to change notification settings - Fork 794
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
Conversation
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' { |
There was a problem hiding this comment.
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
) {
There was a problem hiding this comment.
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' ], |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Forgot to update the rspec test.
minute => 5, | ||
require => File['mysqlbackup.sh'], | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
(MODULES-8420) Release prep for 0.5.0
Installs a mysql backup script, cronjob, and priviledged backup user.
Includes rspec tests and updated documentation.