/[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 3483 - (show annotations) (download)
Wed Jun 11 22:29:31 2014 UTC (6 years, 7 months ago) by colin
File size: 4079 byte(s)
mgagit: Add a repo group for infrastructure stuff.

This is slightly recursive as this is where the definitions are kept, but
I'll add a readme to the git repo to make sure no-one actually adds definitions
in this tree (although a pre-receive hook would be better to really ban it)
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 { 'infrastructure':
104 tmpldir => $gitolite_tmpldir,
105 group => 'sysadmin',
106 ml => 'sysadmin',
107 }
108
109 mgagit::tmpl { 'org':
110 tmpldir => $gitolite_tmpldir,
111 group => 'board',
112 ml => 'board',
113 }
114
115 mgagit::tmpl { 'qa':
116 tmpldir => $gitolite_tmpldir,
117 }
118
119 mgagit::tmpl { 'soft':
120 tmpldir => $gitolite_tmpldir,
121 group => 'packagers-committers',
122 }
123
124 mgagit::tmpl { 'web':
125 tmpldir => $gitolite_tmpldir,
126 ml => 'atelier',
127 }
128
129 file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir,
130 $gitolite_hooksdir, $gitolite_commonhooksdir,
131 $reposconf_dir, $vhostdir]:
132 ensure => directory,
133 owner => $git_login,
134 group => $git_login,
135 mode => '0755',
136 }
137
138 file { $gitoliterc:
139 ensure => present,
140 owner => $git_login,
141 group => $git_login,
142 mode => '0644',
143 content => template('mgagit/gitolite.rc'),
144 }
145
146 file { $bindpwfile:
147 ensure => present,
148 owner => $git_login,
149 group => $git_login,
150 mode => '0600',
151 content => inline_template('<%= @bindpw %>'),
152 }
153
154 file { $git_dir:
155 ensure => directory,
156 owner => $git_login,
157 group => $git_login,
158 mode => '0755',
159 }
160
161 file { "$git_homedir/repositories":
162 ensure => 'link',
163 target => $git_dir,
164 }
165
166 apache::vhost::base { $vhost:
167 location => $vhostdir,
168 }
169 }
170 # vim: sw=2

  ViewVC Help
Powered by ViewVC 1.1.28