]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/site/manifests/aptrepo.pp
clean up aptrepo ordering
[dsa-puppet.git] / modules / site / manifests / aptrepo.pp
index c97fade0ea3f6660273676bf628de545a750b186..db6179f10ca01633a0718708cc0fa1c20e6c334a 100644 (file)
@@ -1,6 +1,6 @@
 define site::aptrepo (
-       $url,
-       $suite,
+       $url='',
+       $suite='',
        $components=[],
        $key = undef,
        $keyid = undef,
@@ -45,9 +45,18 @@ define site::aptrepo (
                default: { fail ( "Unknown ensure value: '$ensure'" ) }
        }
 
+       case $ensure {
+               present: {
+                       if !($url and $suite) {
+                               fail ( "Need both url and suite for $name" )
+                       }
+               }
+               default: {}
+       }
+
        file { "/etc/apt/sources.list.d/${name}.list":
                        ensure  => $ensure,
                        content => template('site/aptrepo.erb'),
-                       notify => Exec['apt-get update'],
+                       notify  => Exec['apt-get update'],
        }
 }