aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-12-06 11:12:38 -0200
committerSilvio Rhatto <rhatto@riseup.net>2009-12-06 11:12:38 -0200
commit10165927fe1847be3451413a72c631fe1a99c1f9 (patch)
treebbfb7d485ac1db9d6124223114f89f3b8c936386 /manifests
downloadpuppet-git-10165927fe1847be3451413a72c631fe1a99c1f9.tar.gz
puppet-git-10165927fe1847be3451413a72c631fe1a99c1f9.tar.bz2
Initial import
Diffstat (limited to 'manifests')
-rw-r--r--manifests/git-daemon.pp17
-rw-r--r--manifests/git.pp5
-rw-r--r--manifests/gitosis.pp44
-rw-r--r--manifests/gitweb.pp15
-rw-r--r--manifests/init.pp6
5 files changed, 87 insertions, 0 deletions
diff --git a/manifests/git-daemon.pp b/manifests/git-daemon.pp
new file mode 100644
index 0000000..bd3bc68
--- /dev/null
+++ b/manifests/git-daemon.pp
@@ -0,0 +1,17 @@
+# This class configures the git-daemon service. It ensures the packages is
+# installed and a line is present in /etc/inetd.conf, which configures it.
+# It depends on a "line" definition, which can be found here:
+#
+# http://reductivelabs.com/trac/puppet/wiki/Recipes/SimpleText
+
+class git-daemon inherits gitosis {
+ # 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 gitosis /usr/bin/git git daemon --inetd --verbose --base-path=/var/git/repositories /var/git/repositories",
+ ensure => present,
+ }
+}
diff --git a/manifests/git.pp b/manifests/git.pp
new file mode 100644
index 0000000..3d564c4
--- /dev/null
+++ b/manifests/git.pp
@@ -0,0 +1,5 @@
+# This class is the base for any other services handled by this module.
+
+class git {
+ package { "git-core": ensure => installed }
+}
diff --git a/manifests/gitosis.pp b/manifests/gitosis.pp
new file mode 100644
index 0000000..819fec4
--- /dev/null
+++ b/manifests/gitosis.pp
@@ -0,0 +1,44 @@
+# This class handles a gitosis installation, with /var/git as the root for
+# git repositories.
+
+class gitosis inherits git {
+ # directory for gitosis user and repositories
+ file { "/var/git":
+ ensure => directory,
+ mode => 0755,
+ owner => gitosis,
+ group => gitosis;
+ }
+
+ # symbolic link
+ file { "/var/cache/git":
+ ensure => "/var/git/repositories",
+ force => true,
+ }
+
+ # the needed packages
+ package { "gitosis": ensure => installed; }
+
+ # alters the user's home dir
+ user { "gitosis":
+ allowdupe => false,
+ comment => "git repository hosting,,,",
+ ensure => present,
+ home => "/var/git",
+ shell => "/bin/sh",
+ groups => [ "gitosis", "puppet" ],
+ require => Group["gitosis"];
+ }
+
+ # ensures that the group exists
+ group { "gitosis":
+ ensure => present,
+ allowdupe => false;
+ }
+
+ # tries to get rid of ugly directory structure
+ file { "/srv/gitosis":
+ ensure => absent,
+ force => true;
+ }
+}
diff --git a/manifests/gitweb.pp b/manifests/gitweb.pp
new file mode 100644
index 0000000..93c3382
--- /dev/null
+++ b/manifests/gitweb.pp
@@ -0,0 +1,15 @@
+# This class handles a gitweb installation.
+
+class gitweb inherits gitosis {
+ # the needed packages
+ package { gitweb: ensure => installed; }
+
+ # gitweb config file
+ file { "/etc/gitweb.conf":
+ owner => "root",
+ group => "root",
+ mode => 0644,
+ ensure => present,
+ content => template('git/gitweb.conf.erb'),
+ }
+}
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644
index 0000000..8a7b270
--- /dev/null
+++ b/manifests/init.pp
@@ -0,0 +1,6 @@
+# The classes used by this module are imported here.
+
+import "git.pp"
+import "gitosis.pp"
+import "gitweb.pp"
+import "git-daemon.pp"