From: Stephen Gran Date: Mon, 16 Apr 2012 14:47:48 +0000 (+0100) Subject: Revert "this is supposed to work" - it seems it doesn't X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=commitdiff_plain;h=ac4a73e1f689b444e3d559e6f87aa99c1e378f08 Revert "this is supposed to work" - it seems it doesn't This reverts commit 3ae1d19e3d1e64321475bceed121a37522dd8226. --- diff --git a/modules/site/manifests/aptrepo.pp b/modules/site/manifests/aptrepo.pp index cea4281e..ae66d6f2 100644 --- a/modules/site/manifests/aptrepo.pp +++ b/modules/site/manifests/aptrepo.pp @@ -1,5 +1,6 @@ define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config = undef, $ensure = present) { + case $ensure { present: { if $key { @@ -31,7 +32,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}", } } } @@ -42,15 +43,19 @@ 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}" ) - } } - file { "/etc/apt/sources.list.d/${name}.list": - ensure => $ensure, - content => template($template), - source => $config, - notify => Exec['apt-get update'], + 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'], + } } }