Jira (FACT-1403) timestamp as a default fact

2 views
Skip to first unread message

Andreas Papst (JIRA)

unread,
Apr 28, 2016, 8:00:03 AM4/28/16
to puppe...@googlegroups.com
Andreas Papst created an issue
 
Facter / New Feature FACT-1403
timestamp as a default fact
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2016/04/28 4:59 AM
Priority: Trivial Trivial
Reporter: Andreas Papst

Hello,

to me it is important to know, when data (facts) were generated. In particular it is crucial if these facts are stored for example in puppetDB.

Thus I wrote a tiny extension I'd like to share with you. Maybe it is useful for somebody else too.

Facter.add(:facts_timestamp) do
  setcode do
    report = {}
    dt = Time.now
    report['Unix timestamp'] = dt.to_i
    report['UTC timestamp'] = dt.utc.to_s
    report['local timestamp'] = dt.getlocal.to_s
    report['local zone'] = dt.getlocal.zone.to_s
    report['local dst'] = dt.getlocal.isdst.to_s
    report['UTC timestamp array'] = dt.to_a
    report['local timestamp array'] = dt.getlocal.to_a
    report
  end
end

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Maggie Dreyer (JIRA)

unread,
May 17, 2017, 2:37:03 PM5/17/17
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Labels: training
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Maggie Dreyer (JIRA)

unread,
May 17, 2017, 2:38:02 PM5/17/17
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Labels: training triaged

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:45:38 PM5/18/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: triaged

Claudia Petty (Jira)

unread,
Jun 21, 2023, 8:43:03 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
Change By: Claudia Petty
Labels: new-feature
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages