Merge pull request #484 from mhaskel/merge_master_to_next
[puppet-modules/puppetlabs-apt.git] / manifests / source.pp
index 96c174c05e2539e25066198f3a931e36ac22e6af..163a411bb21f426f1ae1f43aeeffc4cd4c188464 100644 (file)
@@ -1,9 +1,9 @@
 # source.pp
 # add an apt source
 define apt::source(
+  $location       = undef,
   $comment        = $name,
   $ensure         = present,
-  $location       = '',
   $release        = $::apt::xfacts['lsbdistcodename'],
   $repos          = 'main',
   $include        = {},
@@ -20,6 +20,10 @@ define apt::source(
     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)