Created
December 11, 2012 00:51
-
-
Save glarizza/4254770 to your computer and use it in GitHub Desktop.
Custom Time Fact
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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