From: Stephen Gran Date: Mon, 16 Apr 2012 14:45:47 +0000 (+0100) Subject: this is supposed to work X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=3ae1d19e3d1e64321475bceed121a37522dd8226;p=mirror%2Fdsa-puppet.git this is supposed to work Signed-off-by: Stephen Gran --- diff --git a/modules/site/manifests/aptrepo.pp b/modules/site/manifests/aptrepo.pp index ae66d6f21..cea4281e2 100644 --- a/modules/site/manifests/aptrepo.pp +++ b/modules/site/manifests/aptrepo.pp @@ -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'], } }