Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7175

{puppetlabs-mysql} : include sample fact for remote mysqld version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mysql
    • Labels:
      None
    • Environment:

      Centos 7

      AWS RDS Aurora MySQL

    • Template:
      MODULES Bug Template
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      I think it would be useful to include a sample fact for collecting the mysqld version on a remote system. There are some examples if you Google them, but this wouldn't work correctly for me in my environment.

      Here is a sample that has been working reliably for me in order to obtain the mysqld version from a remove Aurora MySQL server.

      Facter.add('mysqld_version') do
        setcode do
          default_version = "5.6.10"
          raw_version = Facter::Core::Execution.exec('/usr/bin/mysql --defaults-extra-file=/root/.my.cnf -N -s -e \'SHOW VARIABLES LIKE "version"\' 2>/dev/null')
          raw_version = default_version if raw_version.nil? || raw_version.empty?
          raw_version.slice! "version"
          raw_version.slice! "-log"
          raw_version.strip!
          raw_version
        end
      end

       

      The default_version could be removed, but I set it as a backup in my environment.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bdelamatre Byron DeLaMatre
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support