Support nocontentok for apache2::config
authorPeter Palfrader <peter@palfrader.org>
Fri, 23 Sep 2016 19:53:00 +0000 (21:53 +0200)
committerPeter Palfrader <peter@palfrader.org>
Fri, 23 Sep 2016 19:53:00 +0000 (21:53 +0200)
modules/apache2/manifests/config.pp

index 0bb6a6e..13697cb 100644 (file)
@@ -1,6 +1,7 @@
 define apache2::config (
        $source=undef,
        $content=undef,
+       $nocontentok=undef,
        $ensure=present
 ) {
 
@@ -8,7 +9,7 @@ define apache2::config (
 
        case $ensure {
                present: {
-                       if ! ($source or $content) {
+                       if ! ($source or $content or $nocontentok) {
                                fail ( "No configuration found for ${name}" )
                        }
 
@@ -19,7 +20,7 @@ define apache2::config (
                                        require => Package['apache2'],
                                        notify  => Exec['service apache2 reload'],
                                }
-                       } else {
+                       } elsif $source {
                                file { "/etc/apache2/conf-available/${name}.conf":
                                        ensure  => $ensure,
                                        source  => $source,