]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
this is supposed to work
authorStephen Gran <steve@lobefin.net>
Mon, 16 Apr 2012 14:45:47 +0000 (15:45 +0100)
committerStephen Gran <steve@lobefin.net>
Mon, 16 Apr 2012 14:45:47 +0000 (15:45 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/site/manifests/aptrepo.pp

index ae66d6f216b374dbbba7f006e4557d726ea5e334..cea4281e21c81019d1205250c41f9bca3470c8c1 100644 (file)
@@ -1,6 +1,5 @@
 define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config = undef, $ensure = present) {
 
-
        case $ensure {
                present: {
                        if $key {
@@ -32,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}",
                                }
                        }
                }
@@ -43,19 +42,15 @@ define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config =
                if ! ($config or $template) {
                        fail ( "No configuration found for ${name}" )
                }
+               if ($config and $template) {
+                       fail ( "Can't specify both config and template for ${name}" )
+               }
        }
 
-       if $template {
-               file { "/etc/apt/sources.list.d/${name}.list":
-                       ensure  => $ensure,
-                       content => template($template),
-                       notify => Exec['apt-get update'],
-               }
-       } else {
-               file { "/etc/apt/sources.list.d/${name}.list":
-                       ensure => $ensure,
-                       source => $config,
-                       notify => Exec['apt-get update'],
-               }
+       file { "/etc/apt/sources.list.d/${name}.list":
+               ensure  => $ensure,
+               content => template($template),
+               source  => $config,
+               notify  => Exec['apt-get update'],
        }
 }