From: Stephen Gran Date: Wed, 2 May 2012 07:57:33 +0000 (+0100) Subject: check url and suite only if ensure => present X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=aa05fcb708fb1f890d317fed06ca4e670e2d6ccc;p=mirror%2Fdsa-puppet.git check url and suite only if ensure => present Signed-off-by: Stephen Gran --- diff --git a/modules/site/manifests/aptrepo.pp b/modules/site/manifests/aptrepo.pp index c97fade0e..52036ed9d 100644 --- a/modules/site/manifests/aptrepo.pp +++ b/modules/site/manifests/aptrepo.pp @@ -1,6 +1,6 @@ define site::aptrepo ( - $url, - $suite, + $url='', + $suite='', $components=[], $key = undef, $keyid = undef, @@ -45,6 +45,15 @@ 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'),