#
# http://reductivelabs.com/trac/puppet/wiki/Recipes/SimpleText
-class git-daemon inherits git-manager {
+class git::daemon (
+ $implementation = hiera('git::daemon::implementation', 'gitolite')
+) {
+
+ case $implementation {
+ 'gitosis': {
+ include gitosis
+ }
+ default: {
+ include gitolite
+ }
+ }
+
# the needed packages and services
include inetd
# git-daemon config in inetd
line { "git-daemon-inetd":
file => "/etc/inetd.conf",
- line => "git stream tcp nowait $git_server_implementation /usr/bin/git git daemon --inetd --verbose --base-path=/var/git/repositories /var/git/repositories",
+ line => "git stream tcp nowait ${implementation} /usr/bin/git git daemon --inetd --verbose --base-path=/var/git/repositories /var/git/repositories",
ensure => present,
}
}
+++ /dev/null
-class git-manager {
- case $git_server_implementation {
- '': { $git_server_implementation = 'gitolite' }
- }
-
- case $git_server_implementation {
- 'gitosis': {
- include gitosis
- }
- default: {
- include gitolite
- }
- }
-}
# This class handles a gitweb installation.
-class gitweb inherits git-manager {
+class gitweb(
+ $protocol = hiera('git::web::protocol', 'git'),
+ $hosting_domain = hiera('git::web::hosting_domain', $::domain)
+ $implementation = hiera('git::daemon::implementation', 'gitolite')
+) {
+
# the needed packages
package { gitweb: ensure => installed }
- $hosting_domain = $base_domain ? {
- '' => $domain,
- default => $base_domain,
- }
-
- $base_url_protocol = $gitweb_protocol ? {
- '' => 'git',
- default => $gitweb_protocol,
- }
-
# gitweb config file
file { "/etc/gitweb.conf":
owner => "root",
import "git.pp"
import "gitosis.pp"
import "gitweb.pp"
-import "git-daemon.pp"
-import "git-manager.pp"
+import "daemon.pp"
import "gitolite.pp"
$home_text = "indextext.html";
# file with project list; by default, simply scan the projectroot dir.
-$projects_list = "/var/git/<% if git_server_implementation == 'gitosis' %><%= git_server_implementation %>/<% end %>projects.list";
+$projects_list = "/var/git/<% if implementation == 'gitosis' %><%= implementation %>/<% end %>projects.list";
# stylesheet to use
$stylesheet = "/gitweb.css";
$favicon = "/git-favicon.png";
# header url
-@git_base_url_list = ('<%= base_url_protocol %>://git.<%= hosting_domain %>');
+@git_base_url_list = ('<%= protocol %>://git.<%= hosting_domain %>');