File: mysql_version.rb

package info (click to toggle)
puppet-module-puppetlabs-mysql 15.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 968 kB
  • sloc: ruby: 1,648; sh: 43; makefile: 5
file content (9 lines) | stat: -rw-r--r-- 260 bytes parent folder | download
1
2
3
4
5
6
7
8
9
# frozen_string_literal: true

Facter.add('mysql_version') do
  confine { Facter::Core::Execution.which('mysql') }
  setcode do
    mysql_ver = Facter::Core::Execution.execute('mysql --version')
    mysql_ver.match(%r{\d+\.\d+\.\d+})[0] if mysql_ver
  end
end