Sha256: 720c5369be34951b7e101078721dc10c754677676fa64e31b0208a20d07580a9

Contents?: true

Size: 603 Bytes

Versions: 8

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    class AioAgentVersion < BaseResolver
      @fact_list ||= {}

      class << self
        private

        def post_resolve(fact_name)
          @fact_list.fetch(fact_name) { read_agent_version }
        end

        def read_agent_version
          aio_agent_version = Util::FileHelper.safe_read('/opt/puppetlabs/puppet/VERSION', nil)&.chomp
          aio_agent_version = aio_agent_version&.match(/^\d+\.\d+\.\d+(\.\d+){0,2}/)&.to_s
          @fact_list[:aio_agent_version] = aio_agent_version
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
facter-4.0.44 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.43 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.42 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.41 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.40 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.39 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.38 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.37 lib/facter/resolvers/aio_agent_version.rb