We already had a feature to manage and purge entries in preferences.d
but not the preferences file in /etc/apt. This commit adds that
capability.
Fixes#199
The update to separate Exec["apt-get update ${name}"] to single exec in
apt::update class resulted in apt-get update command to be dangled.
Previously if user specified Package['package_a'] <-
Apt::Resource['source_a'], the original refactor would no longer
guarantee apt-get update is executed before the package is installed.
This patch fixes the problem using the anchor resource and ensuring the
old behaviour is maintained and user can depend on apt-get update
command being invoked if they specify dependency on any apt::*
define resource type as well as the apt class.
Move apt-get update exec to a seperate class to minimize the number of
apt-get updates invoked by configuration changes.
* remove apt_update exec resource in apt class.
* remove apt-get-${name} in defines.
* apt::source notify Exec['apt update'].
* Remove dependency to Exec['apt_update'].
* fix rspec-puppet tests.
Conflicts:
manifests/source.pp
This patch adds the appropriate spec tests to validate the changes
introduced by e5f2dfe. As a bonus it includes fixes to the manifests
that were discovered while writing the tests.
With the addition of this patch two new defines will be added; one to
manage APT configuration files (apt::conf) and one that abstracts out the
requirements needed to turn on backport repositories (apt::backports).
In addition, the patch takes the opportunity to clean up variable
definitions so they follow a consistent pattern of setting local
variables to the fully qualified value stored in the apt::params
class. Previously all variable used within a class directly addressed
the apt::params namespace when ever the variable was used. In the
pattern they now adhere to we can more easily switch the namespace
data lives in or externalize it even more using hiera.
Prior to this commit, when using the purge option, unmanaged entries
in both /etc/apt/sources.list and sources.list.d would be purged.
This commit splits purge into purge_sources_list and purge_sources_list_d
which handle the purging of those items separately. Brief documentation on
each added to class documentation.
The setting `disable_keys => true` parameter in the apt module creates
/etc/apt/apt.conf.d/99unauth with the contents
"APT::Get::AllowUnauthenticated 1;". Changing `disable_keys`
does not remove this file. This patch makes it so that
`disable_keys => false` will remove /etc/apt/apt.conf.d/99unauth.
When the name is used with a file resource, it becomes difficult to test the
resource using rspec-puppet, as the name parameter gets aliased to path. So to
maintain consistency between tests and manifests, this replaces all name
parameters in file resources with the equivalent path parameter.
both of these params facilitate options that
ease the management of apt repos in dev
environments
1. disable_keys - allows repos without properly
signed keys
2. always_apt_update - refreshes via apt update
every time that puppet runs.