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

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

    Details

    • Type: Bug
    • Status: Ready for Engineering
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: PUP 5.y
    • Component/s: None
    • Labels:
    • Template:
    • Acceptance Criteria:
      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
    • Team:
      Coremunity
    • Story Points:
      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

              • Assignee:
                Unassigned
                Reporter:
                malfke Martin Alfke
              • Votes:
                0 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Zendesk Support