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

Puppet lookup CLI loads external Facts on the initiating node

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • FACT 3.14.13
    • None
    • Night's Watch
    • 3
    • NW - 2020-07-08, NW - 2020-07-21, NW - 2020-08-06, NW - 2020-08-18
    • Customer Feedback
    • Reviewed
    • 39561
    • 1
    • Bug Fix
    • 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.
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support