From aa71fc9da407f9bc8fac061f5316498294f61759 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 24 Feb 2011 18:52:53 +0000 Subject: - add 2 class to add group to a django application, as well as permission ( used for tx ) --- modules/django_application/manifests/init.pp | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'modules/django_application/manifests') diff --git a/modules/django_application/manifests/init.pp b/modules/django_application/manifests/init.pp index 522f4472..d8bedbef 100644 --- a/modules/django_application/manifests/init.pp +++ b/modules/django_application/manifests/init.pp @@ -15,4 +15,36 @@ class django_application { source => "puppet:///modules/django_application/custom_backend.py", notify => Service['apache'] } + + define script() { + file { $name: + path => "/usr/local/bin/$name", + ensure => present, + owner => root, + group => root, + mode => 755, + source => "puppet:///modules/django_application/$name", + } + } + + script { ['django_create_group.py','django_add_permission_to_group.py']: + } + + 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) { + exec { "/usr/local/bin/django_add_permission_to_group.py $group $name": + user => root, + environment => ["DJANGO_SETTINGS_MODULE=$module.settings", + "PYTHONPATH=$path" ], + require => Django_application::Script['django_add_permission_to_group.py'] + } + } } -- cgit v1.2.1