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

Problem overriding system fact (last_run)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Cannot Reproduce
    • Affects Version/s: FACT 2.4.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:

      Description

      In PDB-1124 I was advised to override last_run builtin fact to add nanoseconds.
      But it seems like it doesn't work on CentOS7 (Ruby 2.0), but ok CentOS5 (Ruby 1.8.7):
      I have correct new fact in /etc/puppet/modules/my/lib/facter/last_run.rb
      I have default last_run fact in /var/lib/puppet/lib/facter/last_run.rb
      On CentOS 7 if I replace 2nd with 1st, during puppet run it get reverted back.
      On CentOS 5 1st = 2nd and all works as intended.

      Fact code:

      Facter.add("last_run") do
        has_weight 100
        confine :kernel => [ 'Linux' , 'SunOS' , 'FreeBSD' , 'Darwin' ]
        setcode do
          Facter::Util::Resolution.exec("date '+%a %b %d %T:%N %Z %Y'")
        end
      end
      

      Facter info:

      Installed Packages
      Name        : facter
      Arch        : x86_64
      Epoch       : 1
      Version     : 2.4.3
      Release     : 1.el7
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                a_fomenko Anton Fomenko
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support