Sha256: 576cbf9de9c9690f3a1b74c8455c23e5028b7be6544d2e234630abaceab2d6be

Contents?: true

Size: 1.78 KB

Versions: 16

Compression:

Stored size: 1.78 KB

Contents

/**
 * @file
 * Declares the Linux virtualization fact resolver.
 */
#pragma once

#include "../resolvers/virtualization_resolver.hpp"
#include <string>

namespace facter { namespace facts { namespace linux {

    /**
     * Responsible for resolving virtualization facts.
     */
    struct virtualization_resolver : resolvers::virtualization_resolver
    {
     protected:
        /**
         * Gets the name of the hypervisor.
         * @param facts The fact collection that is resolving facts.
         * @return Returns the name of the hypervisor or empty string if no hypervisor.
         */
        std::string get_hypervisor(collection& facts) override;
        /**
         * Gets the name of the cloud provider.
         * @param facts The fact collection that is resolving facts.
         * @return Returns the name of the cloud provider or empty string if no hypervisor.
         */
        std::string get_cloud_provider(collection& facts) override;

        /**
         * Gets whether the machine is running in Azure.
         * @param facts The fact collection that is resolving facts.
         * @param leases_file The location of where the leases file exists.
         * @return Returns "azure" if running on azure, otherwise an empty string.
         */
        static std::string get_azure(collection& facts, std::string const& leases_file = "/var/lib/dhcp/dhclient.eth0.leases");

     private:
        static std::string get_cgroup_vm();
        static std::string get_gce_vm(collection& facts);
        static std::string get_what_vm();
        static std::string get_vserver_vm();
        static std::string get_vmware_vm();
        static std::string get_openvz_vm();
        static std::string get_xen_vm();
        static std::string get_lspci_vm();
    };

}}}  // namespace facter::facts::linux

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.12.1.cfacter.20181031 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.11.6.cfacter.20181031 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.12.1.cfacter.20181023 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.11.5.cfacter.20181022 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.12.0.cfacter.20181004 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.12.0.cfacter.20181001 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.12.0.cfacter.20180918 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.11.4.cfacter.20180821 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.11.3.cfacter.20180716 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.11.2.cfacter.20180612 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.9.6.cfacter.20180612 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.11.2.cfacter.20180606 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.9.6.cfacter.20180606 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
facter-3.11.0.cfacter.20180319 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp
cfacter-3.11.0.rc.20180314 ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp