puppetlabs/puppetlabs-apt — pull request #293 by kmullin (2014-05-13 18:38:58+00:00)
Title: Allow $apt_ppa_package to be used from params

This change moves the apt ppa support package name
logic from ppa.pp to params.pp, so that it can be used
externally from other modules.

Use case:
There seems to be a chicken and egg scenario when using the apt module with
`purge_sources_list` and `purge_sources_list_d` set to `true` while also having an `apt::ppa` defined within the catalog.

Apt module wipes all the sources files, then tries to add the ppa, but first requires
```package { 'python-software-properties' }```.
With the sources files wiped completely, apt now doesn't have a cache of packages, so apt errors with the following:

```
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install python-software-properties' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package python-software-properties is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-software-properties' has no installation candidate
```

This change allows at least the name of the package to be available to read from other modules, so in an apt wrapper we can do the following:

```
class { '::apt':
purge_sources_list => true,
purge_sources_list_d => true,
always_apt_update => true
}

$apt_ppa_package = $apt::params::apt_ppa_package

package { $apt_ppa_package: }

Package[$apt_ppa_package] -> Class['::apt']
```

This allows people to use the logic of the package naming you have in the module to install it themselves before the Apt module starts managing the Apt sources.