Merge pull request #484 from mhaskel/merge_master_to_next
[puppet-modules/puppetlabs-apt.git] / manifests / source.pp
index 9b3405797a83b5734619ff300fca1f6006d99714..163a411bb21f426f1ae1f43aeeffc4cd4c188464 100644 (file)
@@ -1,26 +1,31 @@
 # source.pp
 # add an apt source
 define apt::source(
+  $location       = undef,
   $comment        = $name,
   $ensure         = present,
-  $location       = '',
   $release        = $::apt::xfacts['lsbdistcodename'],
   $repos          = 'main',
-  $include_src    = false,
-  $include_deb    = true,
+  $include        = {},
   $key            = undef,
   $pin            = false,
   $architecture   = undef,
-  $trusted_source = false,
+  $allow_unsigned = false,
 ) {
   validate_string($architecture, $comment, $location, $repos)
-  validate_bool($trusted_source, $include_src, $include_deb)
+  validate_bool($allow_unsigned)
+  validate_hash($include)
 
   unless $release {
     fail('lsbdistcodename fact not available: release parameter required')
   }
 
+  if $ensure == 'present' and ! $location {
+    fail('cannot create a source entry without specifying a location')
+  }
+
   $_before = Apt::Setting["list-${title}"]
+  $_include = merge($::apt::include_defaults, $include)
 
   if $key {
     if is_hash($key) {