diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2009-11-08 15:00:24 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2009-11-08 15:00:24 -0200 |
commit | 52131ffc1d82a4ce3ef3aa7c764b1e6b900bd2ba (patch) | |
tree | c673d49e307d9c6073be858f7555b82080694d3d | |
parent | 3b0758a469e5093c9b64205c3e15080b4e590b48 (diff) | |
download | puppet-apache-52131ffc1d82a4ce3ef3aa7c764b1e6b900bd2ba.tar.gz puppet-apache-52131ffc1d82a4ce3ef3aa7c764b1e6b900bd2ba.tar.bz2 |
Ensure that docroot parent folder creation is just defined once
-rw-r--r-- | manifests/init.pp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 8a9a548..077e5e2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -74,6 +74,14 @@ class apache { '': { $apache_www_folder = '/var/www' } } + case $apache_error_folder { + '': { $apache_error_folder = '/var/www/error' } + } + + case $apache_error_dest { + '': { $apache_error_dest = '/var/www/error/index.html' } + } + define site($ensure = present, $docroot = false, $redirect = false, $protocol = 'http', $server_alias = false, $use = false, $ticket = false) { @@ -112,9 +120,11 @@ class apache { recurse => true, } } - # Ensure parent folder exist - exec { "/bin/mkdir -p ${docroot}": - before => File["${docroot}"], + if !defined(Exec["/bin/mkdir -p ${docroot}"]) { + # Ensure parent folder exist + exec { "/bin/mkdir -p ${docroot}": + before => File["${docroot}"], + } } exec { "/usr/sbin/a2ensite $name": unless => "/bin/sh -c '[ -L ${apache2_sites}-enabled/$name ] \ |