Skip to content

Commit

Permalink
proxy support for apt::ppa
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Gambarotto committed Jul 11, 2013
1 parent 0e374f0 commit c21730c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions manifests/ppa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@
package { $package: }
}

if defined(Class[apt]) {
$proxy_host = getparam(Class[apt], "proxy_host")
$proxy_port = getparam(Class[apt], "proxy_port")
case $proxy_host {
false: {
$proxy_env = ""
}
default: {$proxy_env = ["http_proxy=http://${proxy_host}:${proxy_port}", "https_proxy=http://${proxy_host}:${proxy_port}"]}
}
} else {
$proxy_env = ""
}
exec { "add-apt-repository-${name}":
environment => $proxy_env,
command => "/usr/bin/add-apt-repository ${name}",
creates => "${sources_list_d}/${sources_list_d_filename}",
logoutput => 'on_failure',
Expand Down

1 comment on commit c21730c

@rosenfeld
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit introduced bug #176.

Please sign in to comment.