Refactored git module.
This commit is contained in:
parent
edf7cd016d
commit
2969c4f033
1 changed files with 71 additions and 24 deletions
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
# Install Git client tools.
|
||||||
|
#
|
||||||
class git::client {
|
class git::client {
|
||||||
|
|
||||||
package { "git":
|
package { "git":
|
||||||
|
@ -8,32 +10,77 @@ class git::client {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class git::server inherits git::client {
|
# Install prequisites for serving Git repositories
|
||||||
|
#
|
||||||
|
# === Global variables
|
||||||
|
#
|
||||||
|
# $git_datadir:
|
||||||
|
# Directory where repositories are stored
|
||||||
|
#
|
||||||
|
class git::server {
|
||||||
|
|
||||||
include inetd::server
|
include git::client
|
||||||
|
|
||||||
package { ["git-daemon", "gitweb"]:
|
if $git_datadir {
|
||||||
ensure => installed,
|
file { "${git_datadir}":
|
||||||
}
|
ensure => directory,
|
||||||
|
mode => 0755,
|
||||||
file { "/git":
|
owner => root,
|
||||||
ensure => "/srv/git",
|
group => root,
|
||||||
}
|
}
|
||||||
|
file { "/srv/git":
|
||||||
file { "/var/www/git/gitweb_config.perl":
|
ensure => link,
|
||||||
ensure => present,
|
target => "${git_datadir}",
|
||||||
source => [ "puppet:///files/git/gitweb_config.perl.${fqdn}",
|
require => File["${git_datadir}"],
|
||||||
"puppet:///files/git/gitweb_config.perl",
|
}
|
||||||
"puppet:///git/gitweb_config.perl", ],
|
} else {
|
||||||
mode => 0644,
|
file { "/srv/git":
|
||||||
owner => root,
|
ensure => directory,
|
||||||
group => root,
|
mode => 0755,
|
||||||
require => Package["gitweb"],
|
owner => root,
|
||||||
}
|
group => root,
|
||||||
|
}
|
||||||
inetd::service { "git":
|
}
|
||||||
ensure => present,
|
|
||||||
require => Package["git-daemon"],
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Install Git daemon
|
||||||
|
#
|
||||||
|
class git::daemon inherits git::server {
|
||||||
|
|
||||||
|
package { "git-daemon":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
include inetd::server
|
||||||
|
|
||||||
|
inetd::service { "git":
|
||||||
|
ensure => present,
|
||||||
|
require => [ File["/srv/git"],
|
||||||
|
Package["git-daemon"] ],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Install gitweb
|
||||||
|
#
|
||||||
|
class git::gitweb inherits git::server {
|
||||||
|
|
||||||
|
package { "gitweb":
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/var/www/git/gitweb_config.perl":
|
||||||
|
ensure => present,
|
||||||
|
source => [ "puppet:///files/git/gitweb_config.perl.${fqdn}",
|
||||||
|
"puppet:///files/git/gitweb_config.perl",
|
||||||
|
"puppet:///git/gitweb_config.perl", ],
|
||||||
|
mode => 0644,
|
||||||
|
owner => root,
|
||||||
|
group => root,
|
||||||
|
require => Package["gitweb"],
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue