simplify site::aptrepo
[mirror/dsa-puppet.git] / modules / site / manifests / aptrepo.pp
index cea4281..ea1b920 100644 (file)
@@ -1,4 +1,4 @@
-define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config = undef, $ensure = present) {
+define site::aptrepo ($key = undef, $keyid = undef, $content = '', $source = '', $ensure = present) {
 
        case $ensure {
                present: {
@@ -31,7 +31,7 @@ define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config =
                                }
                        } elsif $keyid {
                                exec { "apt-key-del-${keyid}":
-                                       command => "apt-key del ${keyid}",
+                                       command     => "apt-key del ${keyid}",
                                }
                        }
                }
@@ -39,18 +39,15 @@ define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config =
        }
 
        if $ensure == present {
-               if ! ($config or $template) {
+               if ! ($source or $content) {
                        fail ( "No configuration found for ${name}" )
                }
-               if ($config and $template) {
-                       fail ( "Can't specify both config and template for ${name}" )
-               }
        }
 
        file { "/etc/apt/sources.list.d/${name}.list":
                ensure  => $ensure,
-               content => template($template),
-               source  => $config,
+               content => $content,
+               source  => $source,
                notify  => Exec['apt-get update'],
        }
 }