Skip to content

Instantly share code, notes, and snippets.

@binford2k
Last active November 10, 2017 19:41
Show Gist options
  • Save binford2k/d5f27993a548fad34ee6e8371347e9f1 to your computer and use it in GitHub Desktop.
Save binford2k/d5f27993a548fad34ee6e8371347e9f1 to your computer and use it in GitHub Desktop.
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