-
Notifications
You must be signed in to change notification settings - Fork 794
[MODULES-3441] Discover mysql version using facts #852
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
@@ -0,0 +1,5 @@ | |||
Facter.add("mysqld_version") do | |||
setcode do | |||
Facter::Util::Resolution.exec('mysqld -V') |
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.
Does this one not need the .compact
method chained on it, like it used to do on the provider?
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 the .compact
is superfluous. It'd remove nil elements from a list. In the provider, the call to .compact
is run against an anonymous, single-item list, where it will have no effect.
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.
💯
Thanks @jtopper, this looks good and satisfies a need. Can you squash the commits? |
I can squash the commits by all means, but the contributing doc requests that contributors "Make commits of logical units". Which is it? :) |
I would squash the docs into the previous commit, since using the fact and updating the documentation about the fact that this is the case should be one thing. |
Yep. What @daenney said. We usually like to combine feature+test+docs into 1 logical commit. So if a reversion or cherry-pick needed to happen, it all comes out as one logical chunk. |
Per https://tickets.puppetlabs.com/browse/MODULES-3441, the mysql module has behaviour which varies by server version. The version is discovered by running mysqld -V. On hosts without a MySQL server package install, this fails, which means that contrary to the README, it's not actually possible to use this module to manage a remote db. This PR moves the version string discovery into a new fact, mysqld_version which is used by the provider. This makes it possible to configure the db version with a custom fact when a remote db (eg AWS RDS) is being managed.
4c1d543
to
ec5450e
Compare
Cool, no problem. I've just squashed everything. |
Thanks for your contribution! |
Woohoo 😄. |
Per https://tickets.puppetlabs.com/browse/MODULES-3441, the mysql module has behaviour which varies by server version. The version is discovered by running
mysqld -V
. On hosts without a MySQL server package install, this fails, which means that contrary to the README, it's not actually possible to use this module to manage a remote db.This PR moves the version string discovery into a new fact,
mysqld_version
which is used by the provider. This makes it possible to configure the db version with a custom fact when a remote db (eg AWS RDS) is being managed.