Created
December 23, 2013 16:40
-
-
Save nohtyp/8100272 to your computer and use it in GitHub Desktop.
puppet fact to determine dns sub-domain to use for dns resolution.
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
#Environment.rb | |
##Determines dns from hostname | |
Facter.add("mydns") do | |
setcode do | |
Senv = Facter.value('hostname').scan(/(^\D+\d)/) | |
if Senv.any? | |
Senv.to_s + ".promnetwork.com" | |
else | |
"no environment" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment