Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-2557

Create rake task that generates mapping between fact name and fact class

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: FACT 4.0.21, FACT 4.0.45
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Night's Watch
    • Sub-team:
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      Hide
      To improve the visibility of what fact/files get loaded for an OS, we provide a rake task that prints all facts and the class that resolved that fact.
      e.g.

      bundle exec rake fact_list_generator'[ubuntu]'

      will generate
      [
        {
          "name": "lsbdistrelease",
          "klass": "Facts::Ubuntu::Lsbdistrelease",
          "type": "legacy"
        },
        {
          "name": "lsbmajdistrelease",
          "klass": "Facts::Ubuntu::Lsbdistrelease",
          "type": "legacy"
        },
      ...
      Show
      To improve the visibility of what fact/files get loaded for an OS, we provide a rake task that prints all facts and the class that resolved that fact. e.g. bundle exec rake fact_list_generator'[ubuntu]' will generate [   {     "name": "lsbdistrelease",     "klass": "Facts::Ubuntu::Lsbdistrelease",     "type": "legacy"   },   {     "name": "lsbmajdistrelease",     "klass": "Facts::Ubuntu::Lsbdistrelease",     "type": "legacy"   }, ...
    • QA Risk Assessment:
      Needs Assessment

      Description

      The rake task should create a mapping between fact names and the class that resolve the fact.
      e.g. For Fedora the list should be similar to:

      [
        {
          "name": "os.architecture",
          "klass": "Facts::El::Os::Architecture",
          "type": "core"
        },
        {
          "name": "architecture",
          "klass": "Facts::El::Os::Architecture",
          "type": "legacy"
        },
        {
          "name": "os.family",
          "klass": "Facts::El::Os::Family",
          "type": "core"
        },
        {
          "name": "osfamily",
          "klass": "Facts::El::Os::Family",
          "type": "legacy"
        },
        {
          "name": "os.distro.codename",
          "klass": "Facts::El::Os::Distro::Codename",
          "type": "core"
        },
        {
          "name": "lsbdistcodename",
          "klass": "Facts::El::Os::Distro::Codename",
          "type": "legacy"
        },
        {
          "name": "os.distro.release",
          "klass": "Facts::El::Os::Distro::Release",
          "type": "core"
        },
        {
          "name": "lsbdistrelease",
          "klass": "Facts::El::Os::Distro::Release",
          "type": "legacy"
        },
        {
          "name": "lsbmajdistrelease",
          "klass": "Facts::El::Os::Distro::Release",
          "type": "legacy"
        },
        {
          "name": "lsbminordistrelease",
          "klass": "Facts::El::Os::Distro::Release",
          "type": "legacy"
        },
        {
          "name": "os.release",
          "klass": "Facts::El::Os::Release",
          "type": "core"
        },
        {
          "name": "operatingsystemmajrelease",
          "klass": "Facts::El::Os::Release",
          "type": "legacy"
        },
        {
          "name": "operatingsystemrelease",
          "klass": "Facts::El::Os::Release",
          "type": "legacy"
        },
        {
          "name": "os.name",
          "klass": "Facts::El::Os::Name",
          "type": "core"
        },
        {
          "name": "operatingsystem",
          "klass": "Facts::El::Os::Name",
          "type": "legacy"
        },
        {
          "name": "augeas.version",
          "klass": "Facts::Linux::Augeas::Version",
          "type": "core"
        },
        {
          "name": "augeasversion",
          "klass": "Facts::Linux::Augeas::Version",
          "type": "legacy"
        },
        {
          "name": "mountpoints",
          "klass": "Facts::Linux::Mountpoints",
          "type": "core"
        },
        {
          "name": "identity.uid",
          "klass": "Facts::Linux::Identity::Uid",
          "type": "core"
        },
        {
          "name": "identity.privileged",
          "klass": "Facts::Linux::Identity::Privileged",
          "type": "core"
        },
        {
          "name": "identity.gid",
          "klass": "Facts::Linux::Identity::Gid",
          "type": "core"
        },
        {
          "name": "identity.user",
          "klass": "Facts::Linux::Identity::User",
          "type": "core"
        },
        {
          "name": "id",
          "klass": "Facts::Linux::Identity::User",
          "type": "legacy"
        },
        {
          "name": "identity.group",
          "klass": "Facts::Linux::Identity::Group",
          "type": "core"
        },
        {
          "name": "gid",
          "klass": "Facts::Linux::Identity::Group",
          "type": "legacy"
        },
        {
          "name": "ruby.sitedir",
          "klass": "Facts::Linux::Ruby::Sitedir",
          "type": "core"
        },
        {
          "name": "rubysitedir",
          "klass": "Facts::Linux::Ruby::Sitedir",
          "type": "legacy"
        },
        {
          "name": "ruby.version",
          "klass": "Facts::Linux::Ruby::Version",
          "type": "core"
        },
        {
          "name": "rubyversion",
          "klass": "Facts::Linux::Ruby::Version",
          "type": "legacy"
        },
        {
          "name": "ruby.platform",
          "klass": "Facts::Linux::Ruby::Platform",
          "type": "core"
        },
        {
          "name": "rubyplatform",
          "klass": "Facts::Linux::Ruby::Platform",
          "type": "legacy"
        },
        {
          "name": "networking.ip",
          "klass": "Facts::Linux::Networking::Ip",
          "type": "core"
        },
        {
          "name": "ipaddress",
          "klass": "Facts::Linux::Networking::Ip",
          "type": "legacy"
        },
        {
          "name": "networking.fqdn",
          "klass": "Facts::Linux::Networking::Fqdn",
          "type": "core"
        },
        {
          "name": "fqdn",
          "klass": "Facts::Linux::Networking::Fqdn",
          "type": "legacy"
        },
        {
          "name": "networking.interfaces",
          "klass": "Facts::Linux::Networking::Interfaces",
          "type": "core"
        },
        {
          "name": "networking.primary",
          "klass": "Facts::Linux::Networking::Primary",
          "type": "core"
        },
        {
          "name": "networking.hostname",
          "klass": "Facts::Linux::Networking::Hostname",
          "type": "core"
        },
        {
          "name": "hostname",
          "klass": "Facts::Linux::Networking::Hostname",
          "type": "legacy"
        },
        {
          "name": "networking.domain",
          "klass": "Facts::Linux::Networking::Domain",
          "type": "core"
        },
        {
          "name": "domain",
          "klass": "Facts::Linux::Networking::Domain",
          "type": "legacy"
        },
        {
          "name": "networking.mac",
          "klass": "Facts::Linux::Networking::Mac",
          "type": "core"
        },
        {
          "name": "macaddress",
          "klass": "Facts::Linux::Networking::Mac",
          "type": "legacy"
        },
        {
          "name": "interfaces",
          "klass": "Facts::Linux::Interfaces",
          "type": "core"
        },
        {
          "name": "disks",
          "klass": "Facts::Linux::Disks",
          "type": "core"
        },
        {
          "name": "ssh",
          "klass": "Facts::Linux::Ssh",
          "type": "core"
        },
        {
          "name": "lsbdistid",
          "klass": "Facts::Linux::Lsbdistid",
          "type": "legacy"
        },
        {
          "name": "puppetversion",
          "klass": "Facts::Linux::PuppetVersion",
          "type": "core"
        },
        {
          "name": "system_uptime.seconds",
          "klass": "Facts::Linux::SystemUptime::Seconds",
          "type": "core"
        },
        {
          "name": "uptime_seconds",
          "klass": "Facts::Linux::SystemUptime::Seconds",
          "type": "legacy"
        },
        {
          "name": "system_uptime.days",
          "klass": "Facts::Linux::SystemUptime::Days",
          "type": "core"
        },
        {
          "name": "uptime_days",
          "klass": "Facts::Linux::SystemUptime::Days",
          "type": "legacy"
        },
        {
          "name": "system_uptime.hours",
          "klass": "Facts::Linux::SystemUptime::Hours",
          "type": "core"
        },
        {
          "name": "uptime_hours",
          "klass": "Facts::Linux::SystemUptime::Hours",
          "type": "legacy"
        },
        {
          "name": "system_uptime.uptime",
          "klass": "Facts::Linux::SystemUptime::Uptime",
          "type": "core"
        },
        {
          "name": "uptime",
          "klass": "Facts::Linux::SystemUptime::Uptime",
          "type": "legacy"
        },
        {
          "name": "path",
          "klass": "Facts::Linux::Path",
          "type": "core"
        },
        {
          "name": "facterversion",
          "klass": "Facts::Linux::Facterversion",
          "type": "core"
        },
        {
          "name": "os.hardware",
          "klass": "Facts::Linux::Os::Hardware",
          "type": "core"
        },
        {
          "name": "hardwaremodel",
          "klass": "Facts::Linux::Os::Hardware",
          "type": "legacy"
        },
        {
          "name": "os.selinux.enforced",
          "klass": "Facts::Linux::Os::Selinux::Enforced",
          "type": "core"
        },
        {
          "name": "selinux_enforced",
          "klass": "Facts::Linux::Os::Selinux::Enforced",
          "type": "legacy"
        },
        {
          "name": "os.selinux.config_mode",
          "klass": "Facts::Linux::Os::Selinux::ConfigMode",
          "type": "core"
        },
        {
          "name": "selinux_config_mode",
          "klass": "Facts::Linux::Os::Selinux::ConfigMode",
          "type": "legacy"
        },
        {
          "name": "os.selinux.config_policy",
          "klass": "Facts::Linux::Os::Selinux::ConfigPolicy",
          "type": "core"
        },
        {
          "name": "selinux_config_policy",
          "klass": "Facts::Linux::Os::Selinux::ConfigPolicy",
          "type": "legacy"
        },
        {
          "name": "os.selinux.current_mode",
          "klass": "Facts::Linux::Os::Selinux::CurrentMode",
          "type": "core"
        },
        {
          "name": "selinux_current_mode",
          "klass": "Facts::Linux::Os::Selinux::CurrentMode",
          "type": "legacy"
        },
        {
          "name": "os.selinux.policy_version",
          "klass": "Facts::Linux::Os::Selinux::PolicyVersion",
          "type": "core"
        },
        {
          "name": "selinux_policyversion",
          "klass": "Facts::Linux::Os::Selinux::PolicyVersion",
          "type": "legacy"
        },
        {
          "name": "os.selinux.enabled",
          "klass": "Facts::Linux::Os::Selinux::Enabled",
          "type": "core"
        },
        {
          "name": "selinux",
          "klass": "Facts::Linux::Os::Selinux::Enabled",
          "type": "legacy"
        },
        {
          "name": "os.distro.description",
          "klass": "Facts::Linux::Os::Distro::Description",
          "type": "core"
        },
        {
          "name": "os.distro.specification",
          "klass": "Facts::Linux::Os::Distro::Specification",
          "type": "core"
        },
        {
          "name": "lsbrelease",
          "klass": "Facts::Linux::Os::Distro::Specification",
          "type": "legacy"
        },
        {
          "name": "os.distro.id",
          "klass": "Facts::Linux::Os::Distro::Id",
          "type": "core"
        },
        {
          "name": "filesystems",
          "klass": "Facts::Linux::Filesystems",
          "type": "core"
        },
        {
          "name": "load_averages",
          "klass": "Facts::Linux::LoadAverages",
          "type": "core"
        },
        {
          "name": "timezone",
          "klass": "Facts::Linux::Timezone",
          "type": "core"
        },
        {
          "name": "kernel",
          "klass": "Facts::Linux::Kernel",
          "type": "core"
        },
        {
          "name": "fips_enabled",
          "klass": "Facts::Linux::FipsEnabled",
          "type": "core"
        },
        {
          "name": "partitions",
          "klass": "Facts::Linux::Partitions",
          "type": "core"
        },
        {
          "name": "dmi.chassis.asset_tag",
          "klass": "Facts::Linux::Dmi::Chassis::AssetTag",
          "type": "core"
        },
        {
          "name": "chassisassettag",
          "klass": "Facts::Linux::Dmi::Chassis::AssetTag",
          "type": "legacy"
        },
        {
          "name": "dmi.chassis.type",
          "klass": "Facts::Linux::Dmi::Chassis::Type",
          "type": "core"
        },
        {
          "name": "chassistype",
          "klass": "Facts::Linux::Dmi::Chassis::Type",
          "type": "legacy"
        },
        {
          "name": "dmi.bios.version",
          "klass": "Facts::Linux::Dmi::Bios::Version",
          "type": "core"
        },
        {
          "name": "bios_version",
          "klass": "Facts::Linux::Dmi::Bios::Version",
          "type": "legacy"
        },
        {
          "name": "dmi.bios.release_date",
          "klass": "Facts::Linux::Dmi::Bios::ReleaseDate",
          "type": "core"
        },
        {
          "name": "bios_release_date",
          "klass": "Facts::Linux::Dmi::Bios::ReleaseDate",
          "type": "legacy"
        },
        {
          "name": "dmi.bios.vendor",
          "klass": "Facts::Linux::Dmi::Bios::Vendor",
          "type": "core"
        },
        {
          "name": "bios_vendor",
          "klass": "Facts::Linux::Dmi::Bios::Vendor",
          "type": "legacy"
        },
        {
          "name": "dmi.manufacturer",
          "klass": "Facts::Linux::Dmi::Manufacturer",
          "type": "core"
        },
        {
          "name": "manufacturer",
          "klass": "Facts::Linux::Dmi::Manufacturer",
          "type": "legacy"
        },
        {
          "name": "dmi.product.uuid",
          "klass": "Facts::Linux::Dmi::Product::Uuid",
          "type": "core"
        },
        {
          "name": "dmi.product.name",
          "klass": "Facts::Linux::Dmi::Product::Name",
          "type": "core"
        },
        {
          "name": "productname",
          "klass": "Facts::Linux::Dmi::Product::Name",
          "type": "legacy"
        },
        {
          "name": "dmi.product.serial_number",
          "klass": "Facts::Linux::Dmi::Product::SerialNumber",
          "type": "core"
        },
        {
          "name": "dmi.board.product",
          "klass": "Facts::Linux::Dmi::Board::Product",
          "type": "core"
        },
        {
          "name": "boardproductname",
          "klass": "Facts::Linux::Dmi::Board::Product",
          "type": "legacy"
        },
        {
          "name": "dmi.board.manufacturer",
          "klass": "Facts::Linux::Dmi::Board::Manufacturer",
          "type": "core"
        },
        {
          "name": "boardmanufacturer",
          "klass": "Facts::Linux::Dmi::Board::Manufacturer",
          "type": "legacy"
        },
        {
          "name": "dmi.board.serial_number",
          "klass": "Facts::Linux::Dmi::Board::SerialNumber",
          "type": "core"
        },
        {
          "name": "boardserialnumber",
          "klass": "Facts::Linux::Dmi::Board::SerialNumber",
          "type": "legacy"
        },
        {
          "name": "memory.swap.available_bytes",
          "klass": "Facts::Linux::Memory::Swap::AvailableBytes",
          "type": "core"
        },
        {
          "name": "swapfree_mb",
          "klass": "Facts::Linux::Memory::Swap::AvailableBytes",
          "type": "legacy"
        },
        {
          "name": "memory.swap.total",
          "klass": "Facts::Linux::Memory::Swap::Total",
          "type": "core"
        },
        {
          "name": "swapsize",
          "klass": "Facts::Linux::Memory::Swap::Total",
          "type": "legacy"
        },
        {
          "name": "memory.swap.available",
          "klass": "Facts::Linux::Memory::Swap::Available",
          "type": "core"
        },
        {
          "name": "swapfree",
          "klass": "Facts::Linux::Memory::Swap::Available",
          "type": "legacy"
        },
        {
          "name": "memory.swap.used",
          "klass": "Facts::Linux::Memory::Swap::Used",
          "type": "core"
        },
        {
          "name": "memory.swap.total_bytes",
          "klass": "Facts::Linux::Memory::Swap::TotalBytes",
          "type": "core"
        },
        {
          "name": "swapsize_mb",
          "klass": "Facts::Linux::Memory::Swap::TotalBytes",
          "type": "legacy"
        },
        {
          "name": "memory.swap.capacity",
          "klass": "Facts::Linux::Memory::Swap::Capacity",
          "type": "core"
        },
        {
          "name": "memory.swap.used_bytes",
          "klass": "Facts::Linux::Memory::Swap::UsedBytes",
          "type": "core"
        },
        {
          "name": "memory.system.available_bytes",
          "klass": "Facts::Linux::Memory::System::AvailableBytes",
          "type": "core"
        },
        {
          "name": "memoryfree_mb",
          "klass": "Facts::Linux::Memory::System::AvailableBytes",
          "type": "legacy"
        },
        {
          "name": "memory.system.total",
          "klass": "Facts::Linux::Memory::System::Total",
          "type": "core"
        },
        {
          "name": "memorysize",
          "klass": "Facts::Linux::Memory::System::Total",
          "type": "legacy"
        },
        {
          "name": "memory.system.available",
          "klass": "Facts::Linux::Memory::System::Available",
          "type": "core"
        },
        {
          "name": "memoryfree",
          "klass": "Facts::Linux::Memory::System::Available",
          "type": "legacy"
        },
        {
          "name": "memory.system.used",
          "klass": "Facts::Linux::Memory::System::Used",
          "type": "core"
        },
        {
          "name": "memory.system.total_bytes",
          "klass": "Facts::Linux::Memory::System::TotalBytes",
          "type": "core"
        },
        {
          "name": "memorysize_mb",
          "klass": "Facts::Linux::Memory::System::TotalBytes",
          "type": "legacy"
        },
        {
          "name": "memory.system.capacity",
          "klass": "Facts::Linux::Memory::System::Capacity",
          "type": "core"
        },
        {
          "name": "memory.system.used_bytes",
          "klass": "Facts::Linux::Memory::System::UsedBytes",
          "type": "core"
        },
        {
          "name": "kernelversion",
          "klass": "Facts::Linux::Kernelversion",
          "type": "core"
        },
        {
          "name": "kernelrelease",
          "klass": "Facts::Linux::Kernelrelease",
          "type": "core"
        },
        {
          "name": "processors.models",
          "klass": "Facts::Linux::Processors::Models",
          "type": "core"
        },
        {
          "name": "processors.count",
          "klass": "Facts::Linux::Processors::Count",
          "type": "core"
        },
        {
          "name": "processorcount",
          "klass": "Facts::Linux::Processors::Count",
          "type": "legacy"
        },
        {
          "name": "processors.isa",
          "klass": "Facts::Linux::Processors::Isa",
          "type": "core"
        },
        {
          "name": "hardwareisa",
          "klass": "Facts::Linux::Processors::Isa",
          "type": "legacy"
        },
        {
          "name": "processors.physicalcount",
          "klass": "Facts::Linux::Processors::Physicalcount",
          "type": "core"
        },
        {
          "name": "physicalprocessorcount",
          "klass": "Facts::Linux::Processors::Physicalcount",
          "type": "legacy"
        },
        {
          "name": "kernelmajversion",
          "klass": "Facts::Linux::Kernelmajversion",
          "type": "core"
        },
        {
          "name": "lsbdistdescription",
          "klass": "Facts::Linux::Lsbdistdescription",
          "type": "legacy"
        }
      ]
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bogdan.irimie Bogdan Irimie
              Reporter:
              bogdan.irimie Bogdan Irimie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support