X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fppa.pp;h=f6c7373d8d3c599c5126d980f2136a47766e67e7;hb=501a1b5627687b13c0809b82db03f9df168fbd7a;hp=bc8d486007980a1770884ffa91d8bce06b90b421;hpb=7875745a8b5fe116df52f39c456e7b40c68c59a1;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/ppa.pp b/manifests/ppa.pp index bc8d486..f6c7373 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -5,7 +5,6 @@ define apt::ppa( $release = $::lsbdistcodename, $options = $apt::params::ppa_options, ) { - include apt::params include apt::update $sources_list_d = $apt::params::sources_list_d @@ -15,7 +14,7 @@ define apt::ppa( } if $::operatingsystem != 'Ubuntu' { - fail("apt::ppa is currently supported on Ubuntu only.") + fail('apt::ppa is currently supported on Ubuntu only.') } $filename_without_slashes = regsubst($name, '/', '-', 'G') @@ -36,23 +35,25 @@ 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 = [] } exec { "add-apt-repository-${name}": - environment => $proxy_env, - command => "/usr/bin/add-apt-repository ${options} ${name}", - unless => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}", - user => 'root', - logoutput => 'on_failure', - notify => Exec['apt_update'], - require => [ + environment => $proxy_env, + command => "/usr/bin/add-apt-repository ${options} ${name}", + unless => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}", + user => 'root', + logoutput => 'on_failure', + notify => Exec['apt_update'], + require => [ File['sources.list.d'], Package[$package], ],