diff --git a/wiki/files/collab-httpd.conf b/wiki/files/collab-httpd.conf new file mode 100644 index 0000000..9c519ce --- /dev/null +++ b/wiki/files/collab-httpd.conf @@ -0,0 +1,4 @@ + + Options +ExecCGI + AllowOverride All + diff --git a/wiki/manifests/init.pp b/wiki/manifests/init.pp index 24b372d..03382c8 100644 --- a/wiki/manifests/init.pp +++ b/wiki/manifests/init.pp @@ -95,13 +95,13 @@ class wiki::collab inherits wiki::graphingwiki::common { # $wiki_datadir: # Directory for wiki data. Defaults to /srv/wikis. # -# $wiki_collab_fqdn: -# FQDN of collab virtual host. Defaults to $homename. +# $collab_webhosts: +# List of collab virtual hosts. Defaults to [ "$homename" ]. # -# $wiki_collab_jabberdomain: +# $collab_jabberdomain: # Domain for jabber extauth. # -# $wiki_collab_conferencedomain: +# $collab_conferencedomain: # Conference domain for jabber extauth. # Defaults to conference.$wiki_collab_jabberdomain. # @@ -235,8 +235,8 @@ class wiki::collab::base { group => root, } - if $wiki_collab_jabberdomain and !$wiki_collab_conferencedomain { - $wiki_collab_conferencedomain = "conference.${wiki_collab_jabberdomain}" + if $collab_jabberdomain and !$collab_conferencedomain { + $collab_conferencedomain = "conference.${collab_jabberdomain}" } file { "/etc/local/collab/collab.ini": @@ -252,24 +252,9 @@ class wiki::collab::base { $wiki_collab_fqdn = $homename } - file { "/srv/www/https/${wiki_collab_fqdn}/collab": - ensure => link, - target => "/srv/wikis/collab/htdocs", - require => File["/srv/www/https/${wiki_collab_fqdn}"], - } - - file { "/srv/www/https/${wiki_collab_fqdn}/moin_static": - ensure => link, - target => $operatingsystem ? { - ubuntu => "/usr/local/share/moin/htdocs", - default => "/usr/share/moin/htdocs", - }, - require => File["/srv/www/https/${wiki_collab_fqdn}"], - } - apache::configfile { "collab.conf": - content => template("wiki/collab-httpd.conf.erb"), - http => false, + http => false, + source => "puppet:///modules/wiki/collab-httpd.conf", } cron { "collab-htaccess": @@ -282,4 +267,27 @@ class wiki::collab::base { require => [ Class["wiki::collab"], File["/srv/wikis/collab/htdocs/.htaccess"], ] } + define configwebhost() { + file { "/srv/www/https/${name}/collab": + ensure => link, + target => "/srv/wikis/collab/htdocs", + require => File["/srv/www/https/${name}"], + } + + file { "/srv/www/https/${name}/moin_static": + ensure => link, + target => $operatingsystem ? { + ubuntu => "/usr/local/share/moin/htdocs", + default => "/usr/share/moin/htdocs", + }, + require => File["/srv/www/https/${name}"], + } + } + + if !$collab_webhosts { + $collab_webhosts = [ "${homename}" ] + } + + configwebhost { $collab_webhosts: } + } diff --git a/wiki/templates/collab-httpd.conf.erb b/wiki/templates/collab-httpd.conf.erb deleted file mode 100644 index 8a9964c..0000000 --- a/wiki/templates/collab-httpd.conf.erb +++ /dev/null @@ -1,4 +0,0 @@ -/collab"> - Options +ExecCGI - AllowOverride All - diff --git a/wiki/templates/collab.ini.erb b/wiki/templates/collab.ini.erb index 9f23914..15e57d4 100644 --- a/wiki/templates/collab.ini.erb +++ b/wiki/templates/collab.ini.erb @@ -17,9 +17,9 @@ piddir=/srv/wikis/collab/run helperuser=collab ## for collab-auth-ejabberd cacherefreshtime=30 -<% if has_variable?("wiki_collab_jabberdomain") -%> +<% if has_variable?("collab_jabberdomain") -%> [jabber] ## also in ejabberd.cfg -jabberdomain=<%= wiki_collab_jabberdomain %> -conferencedomain=<%= wiki_collab_conferencedomain %> +jabberdomain=<%= collab_jabberdomain %> +conferencedomain=<%= collab_conferencedomain %> <% end -%>