But if you are in a puppet exec, do not forget to pass it using the environment keyword ...
Example:
exec { "/usr/bin/bundle install --deployment --without development test postgres aws":
environment => 'http_proxy=http://192.168.1.23:3128',
cwd => "${homedir}/gitlab",
timeout => 3600,
creates => "${homedir}/gitlab/vendor/bundle"
}
