remove port number from hostname
[puppet-modules/puppetlabs-apt.git] / manifests / source.pp
index 734f375f21fa88135b24a3a7ba10ecd55f20f756..c70a8cc66e2e67eabedbcc50b5a8f72f359ba50c 100644 (file)
@@ -18,12 +18,14 @@ define apt::source(
   $key_content       = undef,
   $key_source        = undef,
   $trusted_source    = undef,
+  $notify_update     = true,
 ) {
   validate_string($architecture, $comment, $location, $repos)
   validate_bool($allow_unsigned)
   validate_hash($include)
 
-  include 'apt::params'
+  # This is needed for compat with 1.8.x
+  include ::apt
 
   $_before = Apt::Setting["list-${title}"]
 
@@ -113,16 +115,17 @@ define apt::source(
   }
 
   apt::setting { "list-${name}":
-    ensure  => $ensure,
-    content => template('apt/_header.erb', 'apt/source.list.erb'),
+    ensure        => $ensure,
+    content       => template('apt/_header.erb', 'apt/source.list.erb'),
+    notify_update => $notify_update,
   }
 
   if $pin {
     if is_hash($pin) {
       $_pin = merge($pin, { 'ensure' => $ensure, 'before' => $_before })
     } elsif (is_numeric($pin) or is_string($pin)) {
-      $url_split = split($location, '/')
-      $host      = $url_split[2]
+      $url_split = split($location, '[:\/]+')
+      $host      = $url_split[1]
       $_pin = {
         'ensure'   => $ensure,
         'priority' => $pin,