module-puppetlabs-mysql/lib/facter/mysqld_version.rb
Jon Topper ec5450ec75 Use facts for mysqld version discovery
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.
2016-06-15 10:43:50 +02:00

5 lines
102 B
Ruby

Facter.add("mysqld_version") do
setcode do
Facter::Util::Resolution.exec('mysqld -V')
end
end