aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gitmirror/manifests/init.pp
blob: c1dcd8943bef3db1be434ed179899b27664957ae (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
class gitmirror {

    $git_dir     = '/git'
    $git_login   = 'git'
    $git_homedir = "/var/lib/${git_login}"
    $git_rundir  = '/var/run/on-the-pull'

    group { $git_login:
      ensure => present,
    }

    user { $git_login:
      ensure      => present,
      home        => $git_homedir,
    }

    file { $git_dir:
      ensure => directory,
      owner  => $git_login,
      group  => $git_login,
      mode   => '0755',
    }

    file { $git_rundir:
      ensure => directory,
      mode   => '0755',
    }

    mga_common::local_script { 'on-the-pull':
        source  => 'puppet:///modules/gitmirror/on-the-pull',
    }

    file { '/etc/init.d/on-the-pull':
        source  => 'puppet:///modules/gitmirror/on-the-pull.init',
        mode    => '0755',
    }

    service { 'on-the-pull':
        require  => [
            Mga_common::Local_script["on-the-pull"],
            File['/etc/init.d/on-the-pull'],
        ],
    }

    mga_common::local_script { 'gitmirror-sync-metadata':
        source  => 'puppet:///modules/gitmirror/rsync-metadata.sh',
    }
}