Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6040

"puppet facts" outputs indirector object instead of simple fact list

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Duplicate
    • None
    • None
    • None
    • Hide

      "puppet facts" output is the same as from a run of Facter itself

      Show
      "puppet facts" output is the same as from a run of Facter itself
    • Night's Watch
    • 2

    Description

      When you run puppet facts, you get something like:

      {
       "name": "node name the facts is for",
       "timestamp": "when the facts were retrieved",
       "expiration": "not sure what this is telling us but its also not a fact",
       "values": { ..... these are the actual available facts .... }
      }
      

      This is because it's one of the "indirector faces," and it just spits back a serialized Puppet::Node::Facts object. I posit that nobody wants this: the output of puppet facts should instead be consistent with that of facter, and it should have similar options for outputting as JSON or text.

      One consequence of displaying an indirector object instead of a list of facts is that it's real easy to think "name" and "timestamp" are facts, when they're actually useless noise.


      Original description:

      Some facts which show up when running

      puppet facts
      

      are not available in templates (erb):

      <%= @facts['timestamp'] %>
      <%= @facts['name'] %>
      

      The mentioned facts do not show up in facter -p

      puppet --version
      4.3.2
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              malfke Martin Alfke
              Votes:
              1 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support