summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-01-09 00:27:37 +0000
committermh <mh@immerda.ch>2009-01-09 00:27:37 +0000
commitd3a825d19821ff9318615ac022de89a328c41ccd (patch)
tree815bfcce3520e2677a56a53f54b63e2074fbe417 /manifests
parent698014f451130146aec861281747385cca5abf89 (diff)
added gitwebrepo share possibility for lighttpd
Diffstat (limited to 'manifests')
-rw-r--r--manifests/defines.pp46
-rw-r--r--manifests/init.pp2
-rw-r--r--manifests/web.pp12
-rw-r--r--manifests/web/lighttpd.pp26
-rw-r--r--manifests/web/lighttpd/base.pp7
5 files changed, 92 insertions, 1 deletions
diff --git a/manifests/defines.pp b/manifests/defines.pp
new file mode 100644
index 0000000..93853e1
--- /dev/null
+++ b/manifests/defines.pp
@@ -0,0 +1,46 @@
+# domain: the domain under which this repo will be avaiable
+# projectroot: where the git repos are listened
+# projects_list: which repos to export
+define git::web::repo(
+ $gitwebconfig,
+ $projectroot,
+ $projects_list
+){
+ include git::web
+ $gitweb_url = $name
+ file{"/etc/gitweb.d/${name}.conf":
+ content => template("git/web/config")
+ }
+ case $gitweb_webserver {
+ 'lighttpd': {
+ git::web::repo::lighttpd{$name:
+ gitwebconfig => $gitwebconfig,
+ gitweb_url => $gitweb_url,
+ projectroot => $projectroot,
+ project_list => $projects_list,
+ }
+ }
+ default: { fail("no supported \$gitweb_webserver defined on ${fqdn}, so can't do git::web::repo: ${name}") }
+ }
+
+}
+
+define git::web::repo::lighttpd(
+ $gitwebconfig,
+ $gitweb_url,
+ $projectroot,
+ $projects_list
+){
+ include git::web::lighttpd
+ file{"/etc/lighttpd/gitweb.d/${name}.conf":
+ content => template("git/web/lighttpd"),
+ notify => Service['lighttpd'],
+ owner => root, group => 0, mode => 0644;
+ }
+ line{"add_include_of_gitwebrepo_${name}":
+ line => "Include /etc/lighttpd/gitweb.d/${name}.conf",
+ file => "/etc/lighttpd/lighttpd-gitweb.conf",
+ require => File['/etc/lighttpd/lighttpd-gitweb.conf'],
+ notify => Service['lighttpd'],
+ }
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index e006126..ba0acb8 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -11,7 +11,7 @@
# the Free Software Foundation.
#
-# modules_dir { \"git\": }
+import 'defines.pp'
class git {
include git::base
diff --git a/manifests/web.pp b/manifests/web.pp
index 5ca5019..dd9b022 100644
--- a/manifests/web.pp
+++ b/manifests/web.pp
@@ -4,4 +4,16 @@ class git::web {
ensure => present,
require => Package['git'],
}
+
+ file{'/etc/gitweb.d':
+ ensure => directory,
+ owner => root, group => 0, mode => 0755;
+ }
+ file{'/etc/gitweb.conf':
+ source => [ "puppet://$server/files/git/web/${fqdn}/gitweb.conf",
+ "puppet://$server/files/git/web/gitweb.conf",
+ "puppet://$server/git/web/gitweb.conf" ],
+ require => Package['gitweb'],
+ owner => root, group => 0, mode => 0644;
+ }
}
diff --git a/manifests/web/lighttpd.pp b/manifests/web/lighttpd.pp
new file mode 100644
index 0000000..5784244
--- /dev/null
+++ b/manifests/web/lighttpd.pp
@@ -0,0 +1,26 @@
+class git::web::lighttpd inherits lighttpd {
+ include git::web::lighttpd::base
+
+ file{'/etc/lighttpd/lighttpd-gitweb-defaults.conf':
+ source => [ "puppet://$server/files/git/web/${fqdn}/lighttpd-gitweb-defaults.conf",
+ "puppet://$server/files/git/web/lighttpd-gitweb-defaults.conf",
+ "puppet://$server/git/web/lighttpd-gitweb-defaults.conf" ],
+ require => Package['lighttpd'],
+ notify => Service['lighttpd'],
+ owner => root, group => 0, mode => 0644;
+ }
+
+
+ file{'/etc/lighttpd/lighttpd-gitweb.conf':
+ ensure => present,
+ require => Package['lighttpd'],
+ notify => Service['lighttpd'],
+ owner => root, group => 0, mode => 0644;
+ }
+
+ file{'/etc/lighttpd/gitweb.d':
+ ensure => directory,
+ require => Package['lighttpd'],
+ owner => root, group => 0, mode => 0755;
+ }
+}
diff --git a/manifests/web/lighttpd/base.pp b/manifests/web/lighttpd/base.pp
new file mode 100644
index 0000000..26fd225
--- /dev/null
+++ b/manifests/web/lighttpd/base.pp
@@ -0,0 +1,7 @@
+class git::web::lighttpd::base {
+ File['/etc/lighttpd/lighttpd.conf']{
+ source => [ "puppet://$server/files/git/web/${fqdn}/lighttpd.conf",
+ "puppet://$server/files/git/web/lighttpd.conf",
+ "puppet://$server/git/web/lighttpd.conf" ],
+ }
+}