summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-10-22 23:02:56 +0200
committermh <mh@immerda.ch>2010-10-22 23:02:56 +0200
commita3027bd256133a739dc5ea6002349fdf61cd6e67 (patch)
treebca316790186cd438eac38dc2bc0fe4baf10e1df /manifests
parenta863cadc10448179941f0be1b8c3e56f25c8afa3 (diff)
add xinetd based service
Diffstat (limited to 'manifests')
-rw-r--r--manifests/daemon.pp49
-rw-r--r--manifests/daemon/vhosts.pp14
2 files changed, 51 insertions, 12 deletions
diff --git a/manifests/daemon.pp b/manifests/daemon.pp
index 36c1302..c7df2af 100644
--- a/manifests/daemon.pp
+++ b/manifests/daemon.pp
@@ -5,25 +5,56 @@ class git::daemon {
require => Package['git'],
}
+ include xinetd
+ file{'/etc/xinetd.d/git':
+ require => Package['git-daemon','xinetd'],
+ notify => Service[xinetd],
+ owner => root, group => 0, mode => 0755;
+ }
file{'/etc/init.d/git-daemon':
+ require => Package['git-daemon'],
+ owner => root, group => 0, mode => 0755;
+ }
+ file{'/etc/sysconfig/git-daemon':
+ require => Package['git-daemon'],
+ owner => root, group => 0, mode => 0644;
+ }
+ service{'git-daemon':
+ hasstatus => true,
+ }
+ if $git_daemon == 'service' {
+ File['/etc/xinet.d/git']{
+ source => "puppet:///modules/git/xinetd.d/git.disabled"
+ }
+ File['/etc/init.d/git-daemon']{
source => [ "puppet:///modules/site-git/init.d/${fqdn}/git-daemon",
"puppet:///modules/site-git/init.d/git-daemon",
"puppet:///modules/git/init.d/git-daemon" ],
- require => Package['git-daemon'],
- owner => root, group => 0, mode => 0755;
- }
- file{'/etc/sysconfig/git-daemon':
+ }
+ File['/etc/sysconfig/git-daemon']{
source => [ "puppet:///modules/site-git/sysconfig/${fqdn}/git-daemon",
"puppet:///modules/site-git/sysconfig/git-daemon",
"puppet:///modules/git/sysconfig/git-daemon" ],
- require => Package['git-daemon'],
- owner => root, group => 0, mode => 0644;
- }
- service{'git-daemon':
+ }
+ Service['git-daemon']{
ensure => running,
enable => true,
- hasstatus => true,
require => [ File['/etc/sysconfig/git-daemon'], File['/etc/init.d/git-daemon'] ],
+ }
+ } else {
+ File['/etc/xinetd.d/git']{
+ source => [ "puppet:///modules/site-git/xinetd.d/${fqdn}/git",
+ "puppet:///modules/site-git/xinetd.d/git",
+ "puppet:///modules/git/xinetd.d/git" ],
+ }
+ Service['git-daemon']{
+ ensure => stopped,
+ enable => false,
+ before => [ File['/etc/sysconfig/git-daemon'], File['/etc/init.d/git-daemon'] ],
+ }
+ File['/etc/init.d/git-daemon','/etc/sysconfig/git-daemon']{
+ ensure => absent,
+ }
}
if $use_shorewall {
diff --git a/manifests/daemon/vhosts.pp b/manifests/daemon/vhosts.pp
index 3777fa1..8dd238d 100644
--- a/manifests/daemon/vhosts.pp
+++ b/manifests/daemon/vhosts.pp
@@ -1,7 +1,15 @@
class git::daemon::vhosts inherits git::daemon {
+ if $git_daemon == 'service' {
File['/etc/sysconfig/git-daemon']{
- source => [ "puppet:///modules/site-git/sysconfig/${fqdn}/git-daemon.vhosts",
- "puppet:///modules/site-git/sysconfig/git-daemon.vhosts",
- "puppet:///modules/git/sysconfig/git-daemon.vhosts" ],
+ source => [ "puppet:///modules/site-git/sysconfig/${fqdn}/git-daemon.vhosts",
+ "puppet:///modules/site-git/sysconfig/git-daemon.vhosts",
+ "puppet:///modules/git/sysconfig/git-daemon.vhosts" ],
}
+ } else {
+ File['/etc/xinetd.d/git']{
+ source => [ "puppet:///modules/site-git/xinetd.d/${fqdn}/git.vhosts",
+ "puppet:///modules/site-git/xinetd.d/git.vhosts",
+ "puppet:///modules/git/xinetd.d/git.vhosts" ],
+ }
+ }
}