X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fppa.pp;h=d6b49007608c2f6811d3d4d812b017a200727173;hb=bf92497e62ca6ec11588832a0842ccae974f5adc;hp=4a08dce6fd413134590962f8ad11091b171f5958;hpb=aae853b585329366bf6b3152a7852f2e2fb8b6b4;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 4a08dce..d6b4900 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -1,22 +1,23 @@ # ppa.pp define apt::ppa( $ensure = 'present', - $release = $::lsbdistcodename, $options = $::apt::ppa_options, + $release = $::apt::xfacts['lsbdistcodename'], $package_name = $::apt::ppa_package, $package_manage = false, ) { - if ! $release { + unless $release { fail('lsbdistcodename fact not available: release parameter required') } - if $::operatingsystem != 'Ubuntu' { - fail('apt::ppa is currently supported on Ubuntu only.') + if $::apt::xfacts['lsbdistid'] == 'Debian' { + fail('apt::ppa is not currently supported on Debian.') } $filename_without_slashes = regsubst($name, '/', '-', 'G') $filename_without_dots = regsubst($filename_without_slashes, '\.', '_', 'G') - $filename_without_ppa = regsubst($filename_without_dots, '^ppa:', '', 'G') + $filename_without_pluses = regsubst($filename_without_dots, '\+', '_', 'G') + $filename_without_ppa = regsubst($filename_without_pluses, '^ppa:', '', 'G') $sources_list_d_filename = "${filename_without_ppa}-${release}.list" if $ensure == 'present' { @@ -31,9 +32,9 @@ define apt::ppa( $_proxy = $::apt::_proxy if $_proxy['host'] { if $_proxy['https'] { - $_proxy_env = ["http_proxy=http://${_proxy['host']}:${_proxy['port']}", "https_proxy=https://${_proxy['host']}:${_proxy['port']}"] + $_proxy_env = ["http_proxy=http://${$_proxy['host']}:${$_proxy['port']}", "https_proxy=https://${$_proxy['host']}:${$_proxy['port']}"] } else { - $_proxy_env = ["http_proxy=http://${_proxy['host']}:${_proxy['port']}"] + $_proxy_env = ["http_proxy=http://${$_proxy['host']}:${$_proxy['port']}"] } } else { $_proxy_env = [] @@ -45,7 +46,7 @@ define apt::ppa( unless => "/usr/bin/test -s ${::apt::sources_list_d}/${sources_list_d_filename}", user => 'root', logoutput => 'on_failure', - notify => Exec['apt_update'], + notify => Class['apt::update'], require => $_require, } @@ -57,12 +58,7 @@ define apt::ppa( else { file { "${::apt::sources_list_d}/${sources_list_d_filename}": ensure => 'absent', - notify => Exec['apt_update'], + notify => Class['apt::update'], } } - - # Need anchor to provide containment for dependencies. - anchor { "apt::ppa::${name}": - require => Class['apt::update'], - } }