9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/facter/facts/linux/cloud/provider.rb', line 9
def call_the_resolver
provider = case Facter::Util::Facts::Posix::VirtualDetector.platform
when 'hyperv'
metadata = Facter::Resolvers::Az.resolve(:metadata)
'azure' unless metadata.nil? || metadata.empty?
when 'kvm', 'xen'
metadata = Facter::Resolvers::Ec2.resolve(:metadata)
'aws' unless metadata.nil? || metadata.empty?
when 'gce'
metadata = Facter::Resolvers::Gce.resolve(:metadata)
'gce' unless metadata.nil? || metadata.empty?
end
Facter::ResolvedFact.new(FACT_NAME, provider)
end
|