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