]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Don't check for source / content to be set when removing an APT source.
authorintrigeri <intrigeri@boum.org>
Tue, 8 Jan 2013 17:13:23 +0000 (18:13 +0100)
committerintrigeri <intrigeri@boum.org>
Tue, 8 Jan 2013 17:13:23 +0000 (18:13 +0100)
Else, the sanity checks prevent one from using a simple
  apt::sources_list { "sid.list": ensure => absent }

manifests/sources_list.pp

index 00f609727505188dde5376362507fced0482ccf2..3367f83a512ef30d784a8af102844e66e8214600 100644 (file)
@@ -4,11 +4,13 @@ define apt::sources_list (
   $content = undef
 ) {
 
-  if $source == '' and $content == undef {
-    fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}")
-  }
-  if $source != '' and $content != undef {
-    fail("Only one of \$source or \$content must specified for apt_sources_snippet ${name}")
+  if $ensure == 'present' {
+    if $source == '' and $content == undef {
+      fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}")
+    }
+    if $source != '' and $content != undef {
+      fail("Only one of \$source or \$content must specified for apt_sources_snippet ${name}")
+    }
   }
 
   include apt::dot_d_directories