Sha256: 4d720265db243e78a8b5aa5e60a418b7b1e35e0137b4addf48f30f68a8c26ff8

Contents?: true

Size: 525 Bytes

Versions: 8

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

module Facts
  module Windows
    module Cloud
      class Provider
        FACT_NAME = 'cloud.provider'

        def call_the_resolver
          virtual = Facter::Resolvers::Windows::Virtualization.resolve(:virtual)
          provider = case virtual
                     when 'hyperv'
                       'azure' unless Facter::Resolvers::Az.resolve(:metadata).empty?
                     end

          Facter::ResolvedFact.new(FACT_NAME, provider)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
facter-4.2.7 lib/facter/facts/windows/cloud/provider.rb
facter-4.2.6 lib/facter/facts/windows/cloud/provider.rb
facter-4.2.5 lib/facter/facts/windows/cloud/provider.rb
facter-4.2.4 lib/facter/facts/windows/cloud/provider.rb
facter-4.2.3 lib/facter/facts/windows/cloud/provider.rb
facter-4.2.2 lib/facter/facts/windows/cloud/provider.rb
facter-4.2.1 lib/facter/facts/windows/cloud/provider.rb
facter-4.2.0 lib/facter/facts/windows/cloud/provider.rb