1 |
define git::repository($group, |
2 |
$description = '') { |
3 |
|
4 |
include git::server |
5 |
# http://eagleas.livejournal.com/18907.html |
6 |
# TODO group permission should be handled here too |
7 |
exec { "/usr/local/bin/create_git_repo.sh $name": |
8 |
user => 'root', |
9 |
group => $group, |
10 |
creates => $name, |
11 |
} |
12 |
|
13 |
file { "$name/git-daemon-export-ok": |
14 |
require => Exec["/usr/local/bin/create_git_repo.sh $name"] |
15 |
} |
16 |
|
17 |
file { "$name/description": |
18 |
content => $description, |
19 |
require => File["$name/git-daemon-export-ok"] |
20 |
} |
21 |
|
22 |
file { "$name/hooks/post-receive": |
23 |
mode => '0755', |
24 |
content => template('git/post-receive'), |
25 |
require => File["$name/git-daemon-export-ok"] |
26 |
} |
27 |
|
28 |
file { "$name/config.puppet": |
29 |
require => File["$name/git-daemon-export-ok"], |
30 |
notify => Exec["/usr/local/bin/apply_git_puppet_config.sh $name"], |
31 |
content => template('git/config.puppet'), |
32 |
} |
33 |
|
34 |
# $name is not really used, but this prevent duplicate declaration error |
35 |
exec { "/usr/local/bin/apply_git_puppet_config.sh $name": |
36 |
cwd => $name, |
37 |
user => 'root', |
38 |
refreshonly => true, |
39 |
} |
40 |
} |