summaryrefslogtreecommitdiff
path: root/manifests/daemon.pp
blob: 01cfec2e01a807241a16858dda6d8bfab044df69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
class git::daemon {
  include git
  package{'git-daemon':
    ensure => installed,
    require => Package['git'],
  }

  xinetd::file{'git':
    require => Package['git-daemon'],
  }
  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' {
    Xinetd::File['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" ],
    }
    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" ],
    }
    Service['git-daemon']{
      ensure => running,
      enable => true,
      require => [ File['/etc/sysconfig/git-daemon'], File['/etc/init.d/git-daemon'] ],
    }
  } else {
    Xinetd::File['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 {
    include shorewall::rules::gitdaemon
  }
}