1 |
class git { |
class git { |
2 |
class common { |
class common { |
3 |
package { 'git-core': |
package { 'git-core': } |
|
} |
|
4 |
} |
} |
5 |
|
|
6 |
class server inherits common { |
class server inherits common { |
16 |
} |
} |
17 |
|
|
18 |
file { "/usr/local/bin/create_git_repo.sh": |
file { "/usr/local/bin/create_git_repo.sh": |
|
ensure => present, |
|
|
owner => root, |
|
|
group => root, |
|
19 |
mode => 755, |
mode => 755, |
20 |
source => 'puppet:///modules/git/create_git_repo.sh', |
source => 'puppet:///modules/git/create_git_repo.sh', |
21 |
} |
} |
22 |
|
|
23 |
file { "/usr/local/bin/apply_git_puppet_config.sh": |
file { "/usr/local/bin/apply_git_puppet_config.sh": |
|
ensure => present, |
|
|
owner => root, |
|
|
group => root, |
|
24 |
mode => 755, |
mode => 755, |
25 |
source => 'puppet:///modules/git/apply_git_puppet_config.sh', |
source => 'puppet:///modules/git/apply_git_puppet_config.sh', |
26 |
} |
} |
57 |
} |
} |
58 |
|
|
59 |
file { "$name/git-daemon-export-ok": |
file { "$name/git-daemon-export-ok": |
|
ensure => present, |
|
60 |
require => Exec["/usr/local/bin/create_git_repo.sh $name"] |
require => Exec["/usr/local/bin/create_git_repo.sh $name"] |
61 |
} |
} |
62 |
|
|
63 |
file { "$name/description": |
file { "$name/description": |
|
ensure => present, |
|
64 |
content => $description, |
content => $description, |
65 |
require => File["$name/git-daemon-export-ok"] |
require => File["$name/git-daemon-export-ok"] |
66 |
} |
} |
67 |
|
|
68 |
file { "$name/hooks/post-receive": |
file { "$name/hooks/post-receive": |
|
ensure => present, |
|
|
owner => root, |
|
|
group => root, |
|
69 |
mode => 755, |
mode => 755, |
70 |
content => template('git/post-receive'), |
content => template('git/post-receive'), |
71 |
require => File["$name/git-daemon-export-ok"] |
require => File["$name/git-daemon-export-ok"] |
72 |
} |
} |
73 |
|
|
74 |
file { "$name/config.puppet": |
file { "$name/config.puppet": |
|
ensure => present, |
|
75 |
require => File["$name/git-daemon-export-ok"], |
require => File["$name/git-daemon-export-ok"], |
76 |
notify => Exec["/usr/local/bin/apply_git_puppet_config.sh $name"], |
notify => Exec["/usr/local/bin/apply_git_puppet_config.sh $name"], |
77 |
content => template('git/config.puppet'), |
content => template('git/config.puppet'), |
96 |
} |
} |
97 |
|
|
98 |
file { "$name/description": |
file { "$name/description": |
|
ensure => present, |
|
99 |
content => $description, |
content => $description, |
100 |
} |
} |
101 |
|
|
124 |
} |
} |
125 |
|
|
126 |
file { "/usr/local/bin/update_git_svn.sh": |
file { "/usr/local/bin/update_git_svn.sh": |
|
ensure => present, |
|
|
owner => root, |
|
|
group => root, |
|
127 |
mode => 755, |
mode => 755, |
128 |
source => 'puppet:///modules/git/update_git_svn.sh', |
source => 'puppet:///modules/git/update_git_svn.sh', |
129 |
} |
} |
135 |
} |
} |
136 |
|
|
137 |
file { "$name/.git/hooks/pre-receive": |
file { "$name/.git/hooks/pre-receive": |
|
ensure => present, |
|
|
owner => root, |
|
|
group => root, |
|
138 |
mode => 755, |
mode => 755, |
139 |
content => template('git/pre-receive'), |
content => template('git/pre-receive'), |
140 |
require => Exec["git svn $name"] |
require => Exec["git svn $name"] |
147 |
} |
} |
148 |
|
|
149 |
class svn inherits client { |
class svn inherits client { |
150 |
package { "git-svn": |
package { "git-svn": } |
|
ensure => installed |
|
|
} |
|
151 |
} |
} |
152 |
|
|
153 |
define snapshot($source, $refresh ='*/5', $user = 'root') { |
define snapshot($source, $refresh ='*/5', $user = 'root') { |
170 |
} |
} |
171 |
} |
} |
172 |
} |
} |
|
|
|
|
|
|
|
|
|