Sha256: 1117c342e9e7cfde561a72833b524e28b67ca272c43095941dfe89c281dc8ad1

Contents?: true

Size: 632 Bytes

Versions: 9

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    class AioAgentVersion < BaseResolver
      @semaphore = Mutex.new
      @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

9 entries across 9 versions & 1 rubygems

Version Path
facter-4.0.36 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.35 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.34 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.33 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.32 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.31 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.30 lib/facter/resolvers/aio_agent_version.rb
facter-4.0.29 lib/resolvers/aio_agent_version.rb
facter-4.0.28 lib/resolvers/aio_agent_version.rb