From 2256d3a476f4ee7e16d6e094fd4873a9d6756013 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 17 Jan 2011 15:24:08 +0000 Subject: add a new class to do a mirror of a svn reporitory ( for display purpose with viewvc or any others ) --- modules/subversion/manifests/init.pp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'modules/subversion/manifests/init.pp') diff --git a/modules/subversion/manifests/init.pp b/modules/subversion/manifests/init.pp index 7f09b393..b5131cb5 100644 --- a/modules/subversion/manifests/init.pp +++ b/modules/subversion/manifests/init.pp @@ -273,4 +273,30 @@ class subversion { minute => $refresh } } + + class mirror { + include subversion::tools + file { "/usr/local/bin/create_svn_mirror.sh": + ensure => present, + owner => root, + group => root, + mode => 755, + content => template('subversion/create_svn_mirror.sh') + } + } + + define mirror_repository($source, + $refresh = '*/5') { + include subversion::mirror + + exec { "/usr/local/bin/create_svn_mirror.sh $name $source": + creates => $name, + require => Package['subversion-tools'] + } + + cron { "update $name": + command => "/usr/bin/svnsync synchronize file://$name", + minute => $refresh, + } + } } -- cgit v1.2.1