module-puppetlabs-mysql/lib/facter/mysql_version.rb
Travis Fields 3ce8ad3799 (maint) - Add a fact for capturing the mysql version installed
- Add spec test for mysql_version fact
- Add `mysql_version` fact to README
2015-05-08 08:51:38 -07:00

8 lines
186 B
Ruby

Facter.add("mysql_version") do
setcode do
mysql_ver = Facter::Util::Resolution.exec('mysql --version')
if mysql_ver
mysql_ver.match(/\d+\.\d+\.\d+/)[0]
end
end
end