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

Facter should ensure core facts are resolved before loading custom facts

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • FACT 4.1.0
    • None
    • Night's Watch
    • 5
    • NW - 2021-03-17
    • Needs Assessment
    • Bug Fix
    • Hide
      Updated Facter.value to resolve the facts in a similar way to Facter 3:

      - load the fact_name.rb from the configured custom directories
      - load all the core facts, external facts and env facts
      - load all custom facts
      Show
      Updated Facter.value to resolve the facts in a similar way to Facter 3: - load the fact_name.rb from the configured custom directories - load all the core facts, external facts and env facts - load all custom facts
    • Needs Assessment

    Description

       Facter 4 implements `Facter.value` differently than Facter 3.

      On Facter 3, search is done in multiple steps, and the next step is executed only if the previous one was not able to resolve the fact:

      1. search in the internal collection
      2. load the `fact_name.rb` from the configured custom directories
      3. load all the core facts, external facts and env facts
      4. load all custom facts

      Calling `Facter.value(:os)` will:

      1. search for `os` in its internal collection
      2. load `custom_dir/os.rb`
      3. load core, external and env facts

      Calling `Facter.value(:custom_fact)` will:

      1. search for `custom_fact` in its internal collection
      2. load `custom_dir/custom_fact.rb`
      3. load core, external and env facts
      4. load all custom facts

      On Facter 4, when `Facter.value` is called, Facter will load all the core facts and all the custom facts, then will resolve only the facts that match the requested query.

      Due to this issue, puppet may not be able to manage services, because puppet selects base as the default service provider instead of systemd:

      change from 'stopped' to 'running' failed: Services must specify a start command or a binary (corrective)
      

      Attachments

        Issue Links

          Activity

            People

              gheorghe.popescu Gheorghe Popescu
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support