Last active
November 10, 2017 19:41
-
-
Save binford2k/d5f27993a548fad34ee6e8371347e9f1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Puppet::Parser::Functions.newfunction(:pt_env_facts, :doc => <<-EOS | |
This function exposes PT_* environment variables as a structured fact, $pt_vars | |
EOS | |
) do | |
variables = {} | |
ENV.each do |var, value| | |
if match = var.match(/^PT_(.*)$/) | |
variables[match] = value | |
end | |
end | |
setvar('pt_vars', variables) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment