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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2223 by misc, Sun Jan 8 22:24:53 2012 UTC revision 2679 by misc, Sat Mar 24 15:27:19 2012 UTC
# Line 1  Line 1 
1  # this class hold the common stuff for all django applications  # this class hold the common stuff for all django applications
2  # as we cannot declare the same ressource twice ( ie, python-psycopg2 for example )  # as we cannot declare the same ressource twice ( ie,
3  # it is required to place this in a common class  # python-psycopg2 for example )
4    # it is required to place this in a common class
5  class django_application {  class django_application {
6      package { ['python-django','python-psycopg2','python-django-auth-ldap']: }      package {['python-django',
7                  'python-psycopg2',
8                  'python-django-auth-ldap']: }
9    
10      file { "/usr/local/lib/custom_backend.py":      file { '/usr/local/lib/custom_backend.py':
11          source => "puppet:///modules/django_application/custom_backend.py",          source => 'puppet:///modules/django_application/custom_backend.py',
12          notify => Service['apache']          notify => Service['apache']
13      }      }
14    
15      define script() {      django_application::script { ['django_create_group.py',
16          file { $name:                                    'django_add_permission_to_group.py']: }
             path => "/usr/local/bin/$name",  
             mode => 755,  
             source => "puppet:///modules/django_application/$name",  
         }  
     }  
   
     script { ['django_create_group.py','django_add_permission_to_group.py']: }  
17    
     define create_group($path,$module) {  
         exec { "/usr/local/bin/django_create_group.py $name":  
             user => root,  
             environment => ["DJANGO_SETTINGS_MODULE=$module.settings",  
                             "PYTHONPATH=$path" ],  
             require => Django_application::Script['django_create_group.py']  
         }  
     }  
   
     define add_permission_to_group($path,$module,$group, $app='') {  
         exec { "/usr/local/bin/django_add_permission_to_group.py $group $name $app":  
             user => root,  
             environment => ["DJANGO_SETTINGS_MODULE=$module.settings",  
                             "PYTHONPATH=$path" ],  
             require => Django_application::Script['django_add_permission_to_group.py']  
         }  
     }  
18  }  }

Legend:
Removed from v.2223  
changed lines
  Added in v.2679

  ViewVC Help
Powered by ViewVC 1.1.30