Skip to content

Instantly share code, notes, and snippets.

@glarizza
Created December 11, 2012 00:51
Show Gist options
  • Save glarizza/4254770 to your computer and use it in GitHub Desktop.
Save glarizza/4254770 to your computer and use it in GitHub Desktop.
Custom Time Fact
# Put this in a module in your modulepath
# Drop this file inside a module's 'lib/facter' directory
# Run Puppet to sync down the custom fact
# The fact is accessible in your code as $time_now or absolutely as $::time_now
Facter.add('time_now') do
setcode do
t = Time.now
t.strftime("%H:%M.%S")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment