-
Notifications
You must be signed in to change notification settings - Fork 795
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
Create log-bin directory if it doesn't exist #596
Conversation
can you please squash the changes? we don't wanna have the two prs mixed into one |
} | ||
else { | ||
$logbin = '' | ||
} |
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.
i think this could be expressed better with a selector
i would also make the default
case undef
, so that
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.
I'm struggling to come up with a selector block that replaces this. I'm trying to make sure it handles both log-bin and log_bin (afaik both are acceptable to MySQL).
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.
Would using pick() from stdlib be acceptable?
E.g.
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], '.')
Unfortunately pick() won't let me have the third option as undef or ''. It would mean checking for '.' instead of '' or undef
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.
generally everything from stdlib is fine, since we already depend on it.
I have squashed commits as requested. |
Ok, I have added pick() and used false as the fallback (if the option doesn't exist or is empty), this makes it easy to use in an if statement. |
super! Can you please squash it down to one commit? |
No problem, have done. |
Create log-bin directory if it doesn't exist
thank you @NoodlesNZ \o/ |
Looking at this the dirname() function uses ruby's File.dirname(). If you don't specify a path (i.e. just mysql-bin) then dirname will return . I haven't tested to see if this causes problems, but I'll do a check for . and stop puppet from trying to manage a directory for this. |
Should be addressed in PR #654 |
It seems the MySQL doesn't like it when you use a log-bin directory that doesn't exist. If you add this before the mysql package is installed then it will fail (if the mysql user doesn't exist). If you add the directory after you run the mysql::server class then mysql will fail to start the first time, it will only be resolved on a subsequent puppet run.