Skip to content

Instantly share code, notes, and snippets.

@hunner
Created March 6, 2012 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hunner/1989071 to your computer and use it in GitHub Desktop.
Save hunner/1989071 to your computer and use it in GitHub Desktop.
Puppet environment as a fact
Facter.add(:environment) do
setcode do
if defined? Puppet and Puppet.application_name == :agent
Puppet[:environment]
else
Facter::Util::Resolution.exec('puppet agent --configprint environment')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment