Skip to content

Instantly share code, notes, and snippets.

@beddari
Forked from hunner/environment.rb
Created July 11, 2013 12:13
Show Gist options
  • Save beddari/5974919 to your computer and use it in GitHub Desktop.
Save beddari/5974919 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