Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
Current versions of puppetlabs-apt support looking up apt::sources in hiera. But as per https://docs.puppetlabs.com/hiera/1/puppet.html#priority-only these lookups are priority-only and do not accumulate all definitions of apt::sources in the hierarchy. This seriously limits the usefulness of this feature.
For now I'm working around it by not doing
include apt
|
but
class { "apt":
|
sources => hiera_hash("apt::sources")
|
}
|
Could this be implemented inside the module? The following patch seems to do it for me:
--- a/repo/puppet/modules/apt/manifests/init.pp
|
+++ b/repo/puppet/modules/apt/manifests/init.pp
|
@@ -54,7 +54,6 @@ class apt(
|
$purge_preferences_d = false,
|
$update_timeout = undef,
|
$update_tries = undef,
|
- $sources = undef,
|
$fancy_progress = undef
|
) {
|
|
@@ -200,6 +199,7 @@ class apt(
|
}
|
|
# manage sources if present
|
+ $sources = = hiera_hash("apt::sources")
|
if $sources != undef {
|
validate_hash($sources)
|
create_resources('apt::source', $sources)
|
It basically removes the parameter for automatic lookup and does a hash merge lookup explicitly instead.