Skip to content

Instantly share code, notes, and snippets.

@mootpt
Forked from hunner/environment.rb
Created May 28, 2014 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mootpt/34f5f7c378af28a16c8d to your computer and use it in GitHub Desktop.
Save mootpt/34f5f7c378af28a16c8d to your computer and use it in GitHub Desktop.
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