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

Puppet lookup CLI loads external Facts on the initiating node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: FACT 3.14.13
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Night's Watch
    • Story Points:
      3
    • Sprint:
      NW - 2020-07-08, NW - 2020-07-21, NW - 2020-08-06, NW - 2020-08-18
    • Method Found:
      Customer Feedback
    • CS Priority:
      Reviewed
    • Zendesk Ticket IDs:
      39561
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Some puppet default settings required facter to retrieve the data which
      caused facter to load all external facts that are not used. This can
      slow down puppet if external facts are slow.

      Now, only when performing a lookup command on a remote node, local external facts are not evaluated.
      Show
      Some puppet default settings required facter to retrieve the data which caused facter to load all external facts that are not used. This can slow down puppet if external facts are slow. Now, only when performing a lookup command on a remote node, local external facts are not evaluated.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet lookup CLI loads external Facts on the initiating node, which causes problems as the execution time of these facts is an unknown and limitless variable, which is harmful in needlessly increasing the round trip time of a hiera lookup, which is unfavorable in an automation environment

       

      Reproduction,

       

      In an environment where external facts are plugin synced to the local machine, run a puppet lookup with the --debug flag turned on.

       puppet lookup --node doesntexist foo --debug

      This will show the fact resolution on  the local machine

       
       

      $ puppet lookup --node doesntexist foo --debug ... Debug: Facter: resolving facts from executable file "/opt/puppetlabs/facter/facts.d/slow.rb".
      Debug: Facter: executing command: /opt/puppetlabs/facter/facts.d/slow.rb
      Debug: Facter: slow=true
      Debug: Facter: SLOW FACT
      Debug: Facter: process exited with status code 0.
      Debug: Facter: fact "slow" has resolved to "true".
      Warning: Facter: external fact file "/opt/puppetlabs/facter/facts.d/slow.rb" had output on stderr: SLOW FACT

       
       

       

      details:

       it seems the external fact resolution may have been explicitly added in https://github.com/puppetlabs/facter/blob/bebd6ce74cb735a6393691f0c445b328b59a0a44/lib/src/ruby/ruby.cc#L24 for https://tickets.puppetlabs.com/browse/FACT-1277

       

       

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dorin.pleava Dorin Pleava
              Reporter:
              martin.ewings Marty Ewings
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support