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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1212 - (hide annotations) (download)
Fri Feb 25 18:25:52 2011 UTC (13 years, 2 months ago) by misc
File size: 1750 byte(s)
add support for giving application name when adding permission to a group
1 misc 1183 # this class hold the common stuff for all django applications
2     # as we cannot declare the same ressource twice ( ie, python-psycopg2 for example )
3     # it is required to place this in a common class
4 misc 1141 class django_application {
5     package { ['python-django','python-psycopg2','python-django-auth-ldap']:
6     ensure => installed
7     }
8    
9     file { "custom_backend.py":
10     path => "/usr/local/lib/custom_backend.py",
11     ensure => present,
12     owner => root,
13     group => root,
14     mode => 644,
15     source => "puppet:///modules/django_application/custom_backend.py",
16     notify => Service['apache']
17     }
18 misc 1196
19     define script() {
20     file { $name:
21     path => "/usr/local/bin/$name",
22     ensure => present,
23     owner => root,
24     group => root,
25     mode => 755,
26     source => "puppet:///modules/django_application/$name",
27     }
28     }
29    
30     script { ['django_create_group.py','django_add_permission_to_group.py']:
31     }
32    
33     define create_group($path,$module) {
34     exec { "/usr/local/bin/django_create_group.py $name":
35     user => root,
36     environment => ["DJANGO_SETTINGS_MODULE=$module.settings",
37     "PYTHONPATH=$path" ],
38     require => Django_application::Script['django_create_group.py']
39     }
40     }
41    
42 misc 1212 define add_permission_to_group($path,$module,$group, $app='') {
43     exec { "/usr/local/bin/django_add_permission_to_group.py $group $name $app":
44 misc 1196 user => root,
45     environment => ["DJANGO_SETTINGS_MODULE=$module.settings",
46     "PYTHONPATH=$path" ],
47     require => Django_application::Script['django_add_permission_to_group.py']
48     }
49     }
50 misc 1141 }

  ViewVC Help
Powered by ViewVC 1.1.30