If you need to read the value of an environment variable on the
master, then a custom function could do this easily. Simply return
ENV['PATH'] or whatever environment variable you want in the custom
function block.
# <modulepath>/customfunctions/lib/puppet/parser/functions/getenv.rb
module Puppet::Parser::Functions
newfunction(:getenv, :type => :rvalue ) do |args|
ENV[args[0]]
end
end
# Example
$rubylib = getenv("RUBYLIB")
If you need to read the value of an environment variable on the agent,
then a custom fact could do this easily.
# <modulepath>/customfacts/lib/facter/env_path.rb
require 'facter'
Facter.add('env_path') do
setcode do
ENV['PATH']
end
end
Hope this helps,
--
Jeff McCune
http://www.puppetlabs.com/
Could you describe the problem a bit more? What environment variable
are you setting? What's the 7th field in /etc/redhat-release you're
trying to get? Why is yum not working correctly without this
information?