1 |
dmorgan |
177 |
class transifex { |
2 |
misc |
2229 |
include django_application |
3 |
|
|
|
4 |
|
|
package { 'transifex': } |
5 |
misc |
614 |
|
6 |
misc |
2650 |
$pgsql_password = extlookup('transifex_pgsql','x') |
7 |
|
|
$ldap_password = extlookup('transifex_ldap','x') |
8 |
|
|
|
9 |
misc |
2229 |
$templates_dir = "/var/lib/transifex/templates" |
10 |
misc |
628 |
|
11 |
misc |
2229 |
postgresql::remote_db_and_user { 'transifex': |
12 |
misc |
2650 |
description => 'Transifex database', |
13 |
|
|
password => $pgsql_password, |
14 |
misc |
2229 |
} |
15 |
misc |
614 |
|
16 |
misc |
2229 |
define config() { |
17 |
|
|
$filename = $name |
18 |
misc |
265 |
|
19 |
misc |
2229 |
file { "/etc/transifex/$filename": |
20 |
misc |
2650 |
group => 'apache', |
21 |
|
|
mode => '0640', |
22 |
misc |
2229 |
require => Package['transifex'], |
23 |
misc |
2650 |
notify => Service['apache'], |
24 |
misc |
2229 |
content => template("transifex/$filename"), |
25 |
|
|
} |
26 |
|
|
} |
27 |
dmorgan |
295 |
|
28 |
misc |
2650 |
config { ['20-engines.conf', |
29 |
|
|
'30-site.conf', |
30 |
|
|
'40-apps.conf', |
31 |
|
|
'45-ldap.conf', |
32 |
|
|
'50-project.conf']: } |
33 |
misc |
617 |
|
34 |
misc |
2229 |
subversion::snapshot { $templates_dir: |
35 |
misc |
2650 |
source => 'svn://svn.mageia.org/svn/web/templates/transifex/trunk' |
36 |
misc |
2229 |
} |
37 |
misc |
618 |
|
38 |
misc |
2696 |
apache::vhost::django_app { "transifex.$::domain": |
39 |
misc |
2650 |
module => 'transifex', |
40 |
|
|
use_ssl => true, |
41 |
|
|
module_path => ['/usr/share/transifex','/usr/share','/usr/local/lib/'], |
42 |
|
|
aliases => { '/site_media/static/admin/' => '/usr/lib/python2.6/site-packages/django/contrib/admin/media/', }, |
43 |
misc |
2229 |
} |
44 |
misc |
627 |
|
45 |
misc |
2229 |
# tx need write access there when running in apache |
46 |
misc |
2650 |
file { '/var/lib/transifex/scratchdir/storage_files': |
47 |
|
|
ensure => directory, |
48 |
|
|
owner => 'apache', |
49 |
|
|
group => 'apache', |
50 |
misc |
2229 |
require => Package['transifex'], |
51 |
|
|
} |
52 |
misc |
628 |
|
53 |
misc |
2691 |
apache::vhost::redirect_ssl { "transifex.$::domain": } |
54 |
misc |
622 |
|
55 |
misc |
2229 |
# the group are mapped from ldap, since AUTH_LDAP_FIND_GROUP_PERMS is set to yes |
56 |
|
|
# but the group need to exist in django first |
57 |
misc |
2650 |
django_application::create_group { ['mga-i18n','mga-i18n-committers']: |
58 |
|
|
module => 'transifex', |
59 |
|
|
path => '/usr/share/transifex:/usr/share', |
60 |
misc |
2229 |
} |
61 |
misc |
1383 |
|
62 |
misc |
2229 |
define committers_permission($app='') |
63 |
|
|
{ |
64 |
|
|
# using django_application::add_permission_to_group may cause problem |
65 |
|
|
# if we install a 2nd django application with the same permission name ( as it need |
66 |
|
|
# to be unique ) |
67 |
|
|
django_application::add_permission_to_group { $name: |
68 |
misc |
2650 |
app => $app, |
69 |
|
|
group => 'mga-i18n-committers', |
70 |
|
|
module => 'transifex', |
71 |
|
|
path => '/usr/share/transifex:/usr/share', |
72 |
misc |
2229 |
require => Django_application::Create_group['mga-i18n-committers'], |
73 |
|
|
} |
74 |
misc |
1214 |
} |
75 |
|
|
|
76 |
misc |
2650 |
committers_permission {['add_project', |
77 |
|
|
'change_project', |
78 |
|
|
'delete_project']: } |
79 |
misc |
1573 |
|
80 |
misc |
2650 |
committers_permission {['add_release', |
81 |
|
|
'change_release', |
82 |
|
|
'delete_release']: } |
83 |
|
|
|
84 |
|
|
committers_permission {['add_resource', |
85 |
|
|
'change_resource', |
86 |
|
|
'delete_resource']: |
87 |
|
|
app => 'resources', |
88 |
misc |
2229 |
} |
89 |
dmorgan |
177 |
} |