From e1ba92e9ef7d2840b7ac812cc41747d0db6fb4ec Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 30 Jan 2012 17:09:39 +0200 Subject: [PATCH] Added variable $wiki::moin::shared pointing to moin's static files --- wiki/manifests/init.pp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/wiki/manifests/init.pp b/wiki/manifests/init.pp index fb23eb1..67d6007 100644 --- a/wiki/manifests/init.pp +++ b/wiki/manifests/init.pp @@ -42,12 +42,12 @@ class wiki::moin { require => Util::Patch["/usr/local/src/moin"], } - $htdocs = $operatingsystem ? { - "ubuntu" => "/usr/local/share/moin/htdocs", - default => "/usr/share/moin/htdocs", + $shared = $operatingsystem ? { + "ubuntu" => "/usr/local/share/moin", + default => "/usr/share/moin", } - file { "${htdocs}/.htaccess": + file { "${shared}/htdocs/.htaccess": ensure => present, mode => 0644, owner => "root", @@ -214,11 +214,8 @@ class wiki::collab::base { user => collab, group => collab, path => "/bin:/usr/bin:/sbin:/usr/sbin", - cwd => $operatingsystem ? { - ubuntu => "/usr/local/share/moin/underlay", - default => "/usr/share/moin/underlay", - }, - command => "cp -R * /srv/wikis/collab/underlay && chmod -R g=u,o-rwx /srv/wikis/collab/underlay/*", + cwd => "${wiki::moin::shared}/underlay", + command => "cp -R pages /srv/wikis/collab/underlay && chmod -R g=u,o-rwx /srv/wikis/collab/underlay", creates => "/srv/wikis/collab/underlay/pages", require => File["/srv/wikis/collab/underlay"], } @@ -313,10 +310,7 @@ class wiki::collab::base { file { "/srv/www/https/${name}/moin_static": ensure => link, - target => $operatingsystem ? { - ubuntu => "/usr/local/share/moin/htdocs", - default => "/usr/share/moin/htdocs", - }, + target => "${wiki::moin::shared}/htdocs", require => File["/srv/www/https/${name}"], } }