Created
November 19, 2014 01:35
-
-
Save rodrickbrown/09ec42f57185a549d749 to your computer and use it in GitHub Desktop.
This file contains 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
require 'facter' | |
Facter.add(:system_env) do | |
setcode do | |
hostname = Facter::Util::Resolution.exec('hostname -s') | |
if hostname[4] == "p" | |
env = "prod" | |
elsif hostname[4] == "d" | |
env = "dev" | |
elsif hostname[4] == "u" | |
env = "uat" | |
elsif hostname[4] == "q" | |
env = "qa" | |
else | |
env = "unknown" | |
end | |
end | |
end |
hesco
commented
Nov 19, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment