X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fppa.pp;h=5f5c6ae57421993afa99705d3d63b6de081fd066;hb=d6bdb4d9256415f38ac80a199afbaa8f6a7bad3a;hp=253e72ffb1af0b465f8308469ff20a2988ff8e1d;hpb=3499896505907211b80f0d2976a2d7b8dca9c583;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 253e72f..5f5c6ae 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -3,7 +3,7 @@ define apt::ppa( $ensure = 'present', $release = $::lsbdistcodename, - $options = '-y' + $options = $apt::params::ppa_options, ) { include apt::params include apt::update @@ -14,6 +14,10 @@ define apt::ppa( fail('lsbdistcodename fact not available: release parameter required') } + if $::operatingsystem != 'Ubuntu' { + fail('apt::ppa is currently supported on Ubuntu only.') + } + $filename_without_slashes = regsubst($name, '/', '-', 'G') $filename_without_dots = regsubst($filename_without_slashes, '\.', '_', 'G') $filename_without_ppa = regsubst($filename_without_dots, '^ppa:', '', 'G') @@ -32,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 = [] @@ -45,10 +51,11 @@ define apt::ppa( 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], + File['sources.list.d'], Package[$package], ], }