Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to set http_proxy in environment for rbenv install #117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
pkg/*
tmp/*
bin/*
/.project
1 change: 1 addition & 0 deletions Modulefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ license 'MIT'
summary 'rbenv Ruby Version Manager module'
description 'Puppet module for rbenv Ruby Version Manager'
project_page 'https://github.com/alup/puppet-rbenv'
dependency 'puppetlabs/stdlib', '4.3.2'
9 changes: 8 additions & 1 deletion manifests/compile.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# The following part compiles and installs the chosen ruby version,
# using the "ruby-build" rbenv plugin.
#
# You may define a web proxy using $http_proxy if necessary.
#
define rbenv::compile(
$user,
$ruby = $title,
Expand All @@ -14,6 +16,11 @@
$bundler = present,
) {

$http_proxy_env = $::http_proxy ? {
undef => [],
default => [ "HTTP_PROXY=${::http_proxy}", "http_proxy=${::http_proxy}", "HTTPS_PROXY=${::https_proxy}", "https_proxy=${::https_proxy}" ],
}

# Workaround http://projects.puppetlabs.com/issues/9848
$home_path = $home ? { '' => "/home/${user}", default => $home }
$root_path = $root ? { '' => "${home_path}/.rbenv", default => $root }
Expand Down Expand Up @@ -72,7 +79,7 @@
user => $user,
group => $group,
cwd => $home_path,
environment => [ "HOME=${home_path}", "CONFIGURE_OPTS=${configure_opts}" ],
environment => concat([ "HOME=${home_path}", "CONFIGURE_OPTS=${configure_opts}" ], $http_proxy_env),
creates => "${versions}/${ruby}",
path => $path,
logoutput => 'on_failure',
Expand Down