some link tidy up
authorStephen Gran <steve@lobefin.net>
Thu, 5 Apr 2012 13:08:51 +0000 (14:08 +0100)
committerStephen Gran <steve@lobefin.net>
Thu, 5 Apr 2012 13:08:51 +0000 (14:08 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/apache2/manifests/site.pp

index 708e6fa..3429238 100644 (file)
@@ -41,8 +41,16 @@ define apache2::site (
                }
        }
 
-       file { "/etc/apache2/sites-enabled/${name}":
-               ensure => $link_target,
-               notify => Service['apache2'],
+       if $ensure == present {
+               file { "/etc/apache2/sites-enabled/${name}":
+                       ensure => link,
+                       target => $link_target,
+                       notify => Service['apache2'],
+               }
+       } else {
+               file { "/etc/apache2/sites-enabled/${name}":
+                       ensure => absent,
+                       notify => Service['apache2'],
+               }
        }
 }