Skip to content

Instantly share code, notes, and snippets.

@nohtyp
Created December 23, 2013 16:40
Show Gist options
  • Save nohtyp/8100272 to your computer and use it in GitHub Desktop.
Save nohtyp/8100272 to your computer and use it in GitHub Desktop.
puppet fact to determine dns sub-domain to use for dns resolution.
#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