From: Morgan Haskel Date: Wed, 30 Jul 2014 18:44:51 +0000 (-0400) Subject: Merge pull request #330 from dantman/master X-Git-Tag: 1.6.0~7 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=84b53dcde475d8573f0a609e30b5f876dd08aa69;hp=bc2febe71fa156aa921dbe8578ba7c86224b2b04;p=puppet-modules%2Fpuppetlabs-apt.git Merge pull request #330 from dantman/master Fix inconsistent $proxy_host handling in apt and apt::ppa. --- diff --git a/manifests/init.pp b/manifests/init.pp index 597774c..1c318b6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -139,19 +139,25 @@ class apt( default: { fail('Valid values for disable_keys are true or false') } } - $proxy_set = $proxy_host ? { - undef => absent, - default => present - } - - file { '01proxy': - ensure => $proxy_set, - path => "${apt_conf_d}/01proxy", - content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n", - notify => Exec['apt_update'], - mode => '0644', - owner => root, - group => root, + case $proxy_host { + false, '', undef: { + file { '01proxy': + ensure => absent, + path => "${apt_conf_d}/01proxy", + notify => Exec['apt_update'], + } + } + default: { + file { '01proxy': + ensure => present, + path => "${apt_conf_d}/01proxy", + content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n", + notify => Exec['apt_update'], + mode => '0644', + owner => root, + group => root, + } + } } file { 'old-proxy-file': diff --git a/manifests/ppa.pp b/manifests/ppa.pp index a55e1e0..27edff8 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -36,11 +36,13 @@ define apt::ppa( if defined(Class[apt]) { $proxy_host = $apt::proxy_host $proxy_port = $apt::proxy_port - case $proxy_host { - false, '': { + case $proxy_host { + false, '', undef: { $proxy_env = [] - } - default: {$proxy_env = ["http_proxy=http://${proxy_host}:${proxy_port}", "https_proxy=http://${proxy_host}:${proxy_port}"]} + } + default: { + $proxy_env = ["http_proxy=http://${proxy_host}:${proxy_port}", "https_proxy=http://${proxy_host}:${proxy_port}"] + } } } else { $proxy_env = []