Merge pull request #483 from mhaskel/examples
[puppet-modules/puppetlabs-apt.git] / manifests / source.pp
index 1ceaba96ceb5aae6ed5ec967b59e60e176cbb0f2..163a411bb21f426f1ae1f43aeeffc4cd4c188464 100644 (file)
@@ -1,25 +1,29 @@
 # source.pp
 # add an apt source
 define apt::source(
+  $location       = undef,
   $comment        = $name,
   $ensure         = present,
-  $location       = '',
   $release        = $::apt::xfacts['lsbdistcodename'],
   $repos          = 'main',
   $include        = {},
   $key            = undef,
   $pin            = false,
   $architecture   = undef,
-  $trusted_source = false,
+  $allow_unsigned = false,
 ) {
   validate_string($architecture, $comment, $location, $repos)
-  validate_bool($trusted_source)
+  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)