summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas <andreas@immerda.ch>2009-12-26 21:05:18 +0100
committerAndreas <andreas@immerda.ch>2009-12-26 21:05:18 +0100
commit2cad483fa8b6b216144ee633d40acb577b0b56fc (patch)
tree00723a0f50bba3fcc8fd59bd13f45722f12276bf
parenta395ba844c86232f7f179b773394a72d8e9421d3 (diff)
DAV needs a writable dir for the db (with itk, with the correct user settings)
-rw-r--r--manifests/defaultdavdir.pp9
-rw-r--r--manifests/vhost/davdir.pp40
-rw-r--r--manifests/vhost/webdav.pp13
-rw-r--r--templates/vhosts/webdav/CentOS.erb2
4 files changed, 63 insertions, 1 deletions
diff --git a/manifests/defaultdavdir.pp b/manifests/defaultdavdir.pp
new file mode 100644
index 0000000..694d420
--- /dev/null
+++ b/manifests/defaultdavdir.pp
@@ -0,0 +1,9 @@
+# manifests/defaultphpdirs.pp
+
+class apache::defaultdavdir {
+ file{'/var/www/dav_db_dir':
+ ensure => directory,
+ require => Package['apache'],
+ owner => root, group => 0, mode => 0755;
+ }
+}
diff --git a/manifests/vhost/davdir.pp b/manifests/vhost/davdir.pp
new file mode 100644
index 0000000..341d632
--- /dev/null
+++ b/manifests/vhost/davdir.pp
@@ -0,0 +1,40 @@
+define apache::vhost::davdir(
+ $ensure = present,
+ $dav_db_dir = 'absent',
+ $documentroot_owner = apache,
+ $documentroot_group = 0,
+ $documentroot_mode = 0750,
+ $run_mode = 'normal',
+ $run_uid = 'absent'
+){
+ # php db dir
+ case $dav_db_dir {
+ 'absent': {
+ include apache::defaultdavdir
+ $real_dav_db_dir = "/var/www/dav_db_dir/$name"
+ }
+ default: { $real_dav_db_dir = $dav_db_dir }
+ }
+
+ case $ensure {
+ absent: {
+ file{$real_dav_db_dir:
+ ensure => absent,
+ purge => true,
+ force => true,
+ recurse => true,
+ }
+ }
+ default: {
+ file{$real_dav_db_dir:
+ ensure => directory,
+ owner => $run_mode ? {
+ 'itk' => $run_uid,
+ default => $documentroot_owner
+ },
+ group => $documentroot_group, mode => $documentroot_mode;
+ }
+ }
+ }
+}
+
diff --git a/manifests/vhost/webdav.pp b/manifests/vhost/webdav.pp
index ab99039..8996ab7 100644
--- a/manifests/vhost/webdav.pp
+++ b/manifests/vhost/webdav.pp
@@ -33,8 +33,19 @@ define apache::vhost::webdav(
$htpasswd_file = 'absent',
$htpasswd_path = 'absent',
$ldap_auth = false,
- $ldap_user = 'any'
+ $ldap_user = 'any',
+ $dav_db_dir = 'absent'
){
+ ::apache::vhost::davdir{"${name}":
+ ensure => $ensure,
+ dav_db_dir => $dav_db_dir,
+ documentroot_owner => $documentroot_owner,
+ documentroot_group => $documentroot_group,
+ documentroot_mode => $documentroot_mode,
+ run_mode => $run_mode,
+ run_uid => $run_uid,
+ }
+
if $manage_webdir {
# create webdir
::apache::vhost::webdir{$name:
diff --git a/templates/vhosts/webdav/CentOS.erb b/templates/vhosts/webdav/CentOS.erb
index bf4f2d2..f4a1f71 100644
--- a/templates/vhosts/webdav/CentOS.erb
+++ b/templates/vhosts/webdav/CentOS.erb
@@ -26,6 +26,7 @@
</IfModule>
<%- end -%>
<%- if not ssl_mode.to_s == 'force' then -%>
+ DAVLockDB <%= real_dav_db_dir %>
<Directory "<%= documentroot %>/">
Dav on
AllowOverride None
@@ -100,6 +101,7 @@
<%- if default_charset.to_s != 'absent' then -%>
AddDefaultCharset <%= default_charset %>
<%- end -%>
+ DAVLockDB <%= real_dav_db_dir %>
<Directory "<%= documentroot %>/">
Dav on
AllowOverride None