X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fppa.pp;h=ba05485c31c2ed5792cab8f0ae0a5fb85660627b;hb=d4531de809ed140def5da353235c204f4660e8e4;hp=99af21937529d983cfa4e590ef8e48c7bd3285a9;hpb=e99d83c2d6bdd45a9111eab0306da105c1f2acca;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 99af219..ba05485 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -1,21 +1,46 @@ -# ppa.pp +# @summary Manages PPA repositories using `add-apt-repository`. Not supported on Debian. +# +# @example Example declaration of an Apt PPA +# apt::ppa{ 'ppa:openstack-ppa/bleeding-edge': } +# +# @param ensure +# Specifies whether the PPA should exist. Valid options: 'present' and 'absent'. +# +# @param options +# Supplies options to be passed to the `add-apt-repository` command. Default: '-y'. +# +# @param release +# Optional if lsb-release is installed (unless you're using a different release than indicated by lsb-release, e.g., Linux Mint). +# Specifies the operating system of your node. Valid options: a string containing a valid LSB distribution codename. +# +# @param dist +# Optional if lsb-release is installed (unless you're using a different release than indicated by lsb-release, e.g., Linux Mint). +# Specifies the distribution of your node. Valid options: a string containing a valid distribution codename. +# +# @param package_name +# Names the package that provides the `apt-add-repository` command. Default: 'software-properties-common'. +# +# @param package_manage +# Specifies whether Puppet should manage the package that provides `apt-add-repository`. +# define apt::ppa( String $ensure = 'present', Optional[String] $options = $::apt::ppa_options, Optional[String] $release = $facts['lsbdistcodename'], + Optional[String] $dist = $facts['lsbdistid'], Optional[String] $package_name = $::apt::ppa_package, Boolean $package_manage = false, ) { unless $release { - fail('lsbdistcodename fact not available: release parameter required') + fail(translate('lsbdistcodename fact not available: release parameter required')) } - if $facts['lsbdistid'] == 'Debian' { - fail('apt::ppa is not currently supported on Debian.') + if $dist == 'Debian' { + fail(translate('apt::ppa is not currently supported on Debian.')) } - if versioncmp($facts['lsbdistrelease'], '15.10') >= 0 { - $distid = downcase($facts['lsbdistid']) + if versioncmp($facts['lsbdistrelease'], '14.10') >= 0 { + $distid = downcase($dist) $dash_filename = regsubst($name, '^ppa:([^/]+)/(.+)$', "\\1-${distid}-\\2") $underscore_filename = regsubst($name, '^ppa:([^/]+)/(.+)$', "\\1_${distid}_\\2") } else {