aboutsummaryrefslogtreecommitdiffstats
path: root/modules/subversion/manifests/snapshot.pp
blob: 00e66dde6d1116dcedb357368c4078308d9f833f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
define subversion::snapshot($source,
                            $refresh = '*/5',
                            $user = 'root')  {

    include subversion::client

    exec { "/usr/bin/svn co ${source} ${name}":
        creates => $name,
        user    => $user,
        require => Package['subversion'],
    }

    if ($refresh != '0') {
        cron { "update ${name}":
            command => "cd ${name} && /usr/bin/svn update -q",
            user    => $user,
            minute  => $refresh,
            require => Exec["/usr/bin/svn co ${source} ${name}"],
        }
    }
}