aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/manifests/repository.pp
blob: 4f4f0615bda65cf03ce05fc78b4bf3a4377b8842 (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
define git::repository($group,
                      $description = '') {

    include git::server
    # http://eagleas.livejournal.com/18907.html
    # TODO group permission should be handled here too
    exec { "/usr/local/bin/create_git_repo.sh $name":
        user    => 'root',
        group   => $group,
        creates => $name,
    }

    file { "$name/git-daemon-export-ok":
        require => Exec["/usr/local/bin/create_git_repo.sh $name"]
    }

    file { "$name/description":
        content => $description,
        require => File["$name/git-daemon-export-ok"]
    }

    file { "$name/hooks/post-receive":
        mode    => '0755',
        content => template('git/post-receive'),
        require => File["$name/git-daemon-export-ok"]
    }

    file { "$name/config.puppet":
        require => File["$name/git-daemon-export-ok"],
        notify  => Exec["/usr/local/bin/apply_git_puppet_config.sh $name"],
        content => template('git/config.puppet'),
    }

    # $name is not really used, but this prevent duplicate declaration error
    exec { "/usr/local/bin/apply_git_puppet_config.sh $name":
        cwd         => $name,
        user        => 'root',
        refreshonly => true,
    }
}