/[adm]/puppet/modules/transifex/manifests/init.pp
ViewVC logotype

Annotation of /puppet/modules/transifex/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2229 - (hide annotations) (download)
Sun Jan 8 23:03:24 2012 UTC (12 years, 3 months ago) by misc
File size: 2912 byte(s)
refactor, clean and reindent transfiex module
1 dmorgan 177 class transifex {
2 misc 2229 include django_application
3    
4     package { 'transifex': }
5 dmorgan 240
6 misc 2229 $pgsql_password = extlookup("transifex_pgsql",'x')
7     $ldap_password = extlookup("transifex_ldap",'x')
8 misc 614
9 misc 2229 $templates_dir = "/var/lib/transifex/templates"
10 misc 628
11 misc 2229 postgresql::remote_db_and_user { 'transifex':
12 misc 1356 description => "Transifex database",
13 misc 624 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     group => apache,
21     mode => 640,
22     require => Package['transifex'],
23     notify => Service['apache'],
24     content => template("transifex/$filename"),
25     }
26     }
27 dmorgan 295
28 misc 2229 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     source => "svn://svn.mageia.org/svn/web/templates/transifex/trunk"
36     }
37 misc 618
38 misc 2229 apache::vhost_django_app { "transifex.$domain":
39     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     }
44 misc 627
45 misc 2229 # tx need write access there when running in apache
46     file { "/var/lib/transifex/scratchdir/storage_files":
47     ensure => directory,
48     owner => apache,
49     group => apache,
50     require => Package['transifex'],
51     }
52 misc 628
53 misc 2229 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     django_application::create_group { ["mga-i18n","mga-i18n-committers"]:
58     module => "transifex",
59     path => "/usr/share/transifex:/usr/share",
60     }
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     app => $app,
69     group => 'mga-i18n-committers',
70     module => "transifex",
71     path => "/usr/share/transifex:/usr/share",
72     require => Django_application::Create_group['mga-i18n-committers'],
73     }
74 misc 1214 }
75    
76 misc 2229 committers_permission { ['add_project',
77     'change_project',
78     'delete_project']: }
79 misc 1214
80 misc 2229 committers_permission { ['add_release',
81     'change_release',
82     'delete_release']: }
83 misc 1573
84 misc 2229 committers_permission { ['add_resource',
85     'change_resource',
86     'delete_resource']:
87     app => "resources",
88     }
89 dmorgan 177 }

  ViewVC Help
Powered by ViewVC 1.1.30