/[adm]/puppet/deployment/mgagit/manifests/init.pp
ViewVC logotype

Contents of /puppet/deployment/mgagit/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3419 - (show annotations) (download)
Thu Mar 13 08:59:57 2014 UTC (9 years, 11 months ago) by colin
File size: 3854 byte(s)
Setup git repository groups for 'artwork', 'doc' and 'qa'
1 class mgagit(
2 $git_dir = '/git',
3 $ldap_server = 'ldap.mageia.org',
4 $binddn = 'uid=mgagit,ou=People,dc=mageia,dc=org',
5 $vhost = 'projects.mageia.org',
6 $bindpw
7 ){
8 $git_login = 'git'
9 $git_homedir = "/var/lib/${git_login}"
10 $gitolite_dir = "${git_homedir}/.gitolite"
11 $gitolite_keydir = "${gitolite_dir}/keydir"
12 $gitolite_tmpldir = "/etc/mgagit/tmpl"
13 $gitolite_confdir = "${gitolite_dir}/conf"
14 $gitolite_hooksdir = "${gitolite_dir}/hooks"
15 $gitolite_commonhooksdir = "${gitolite_hooksdir}/common"
16 $gitolite_conf = "${gitolite_confdir}/gitolite.conf"
17 $gitoliterc = "$git_homedir/.gitolite.rc"
18 $bindpwfile = '/etc/mgagit.secret'
19 $reposconf_dir = "${git_homedir}/repos-config"
20 $vhostdir = "$git_homedir/www"
21
22 package { ['mgagit', 'gitolite', 'python-bugz']:
23 ensure => installed,
24 }
25
26 group { $git_login:
27 ensure => present,
28 }
29 user { $git_login:
30 ensure => present,
31 comment => 'Mageia Git',
32 home => $git_homedir,
33 managehome => true,
34 gid => $git_login,
35 }
36
37 file { '/etc/mgagit.conf':
38 ensure => present,
39 owner => root,
40 group => root,
41 mode => '0644',
42 content => template('mgagit/mgagit.conf'),
43 require => Package['mgagit'],
44 }
45
46 file { "$gitolite_commonhooksdir/git_multimail.py":
47 ensure => present,
48 owner => $git_login,
49 group => $git_login,
50 mode => '0644',
51 content => template('mgagit/git_multimail.py'),
52 require => File[$gitolite_commonhooksdir],
53 }
54
55 file { "$gitolite_commonhooksdir/post-receive":
56 ensure => present,
57 owner => $git_login,
58 group => $git_login,
59 mode => '0755',
60 content => template('mgagit/git-post-receive-hook'),
61 require => File[$gitolite_commonhooksdir],
62 }
63
64 file { "$gitolite_commonhooksdir/post-update":
65 ensure => present,
66 owner => $git_login,
67 group => $git_login,
68 mode => '0755',
69 content => template('mgagit/git-post-update-hook'),
70 require => File[$gitolite_commonhooksdir],
71 }
72
73 file { $gitolite_tmpldir:
74 ensure => directory,
75 owner => root,
76 group => root,
77 mode => '0755',
78 }
79
80 file { "$gitolite_tmpldir/group.gl":
81 ensure => 'link',
82 target => '/usr/share/mgagit/tmpl/group.gl',
83 }
84
85 file { "$gitolite_tmpldir/repodef_repo.gl":
86 ensure => present,
87 owner => root,
88 group => root,
89 mode => '0644',
90 content => template('mgagit/repodef_repo.gl'),
91 }
92
93 mgagit::tmpl { 'artwork':
94 tmpldir => $gitolite_tmpldir,
95 ml => 'atelier',
96 }
97
98 mgagit::tmpl { 'doc':
99 tmpldir => $gitolite_tmpldir,
100 ml => 'atelier', # NB This is wrong, we should have a doc-commits@ ML (and thus remove this line)
101 }
102
103 mgagit::tmpl { 'qa':
104 tmpldir => $gitolite_tmpldir,
105 }
106
107 mgagit::tmpl { 'soft':
108 tmpldir => $gitolite_tmpldir,
109 group => 'packagers-committers',
110 }
111
112 mgagit::tmpl { 'web':
113 tmpldir => $gitolite_tmpldir,
114 ml => 'atelier',
115 }
116
117 file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir,
118 $gitolite_hooksdir, $gitolite_commonhooksdir,
119 $reposconf_dir, $vhostdir]:
120 ensure => directory,
121 owner => $git_login,
122 group => $git_login,
123 mode => '0755',
124 }
125
126 file { $gitoliterc:
127 ensure => present,
128 owner => $git_login,
129 group => $git_login,
130 mode => '0644',
131 content => template('mgagit/gitolite.rc'),
132 }
133
134 file { $bindpwfile:
135 ensure => present,
136 owner => $git_login,
137 group => $git_login,
138 mode => '0600',
139 content => inline_template('<%= @bindpw %>'),
140 }
141
142 file { $git_dir:
143 ensure => directory,
144 owner => $git_login,
145 group => $git_login,
146 mode => '0755',
147 }
148
149 file { "$git_homedir/repositories":
150 ensure => 'link',
151 target => $git_dir,
152 }
153
154 apache::vhost::base { $vhost:
155 location => $vhostdir,
156 }
157 }
158 # vim: sw=2

  ViewVC Help
Powered by ViewVC 1.1.30