diff options
author | Michael Scherer <misc@mageia.org> | 2011-02-24 18:52:53 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2011-02-24 18:52:53 +0000 |
commit | aa71fc9da407f9bc8fac061f5316498294f61759 (patch) | |
tree | 638da1a5efe23200c63d40273bf4dc3b1cd70caa /modules/django_application/manifests/init.pp | |
parent | ef45852d0d31fdd1daa39f603cd12171d63a5116 (diff) | |
download | puppet-aa71fc9da407f9bc8fac061f5316498294f61759.tar puppet-aa71fc9da407f9bc8fac061f5316498294f61759.tar.gz puppet-aa71fc9da407f9bc8fac061f5316498294f61759.tar.bz2 puppet-aa71fc9da407f9bc8fac061f5316498294f61759.tar.xz puppet-aa71fc9da407f9bc8fac061f5316498294f61759.zip |
- add 2 class to add group to a django application, as well as
permission ( used for tx )
Diffstat (limited to 'modules/django_application/manifests/init.pp')
-rw-r--r-- | modules/django_application/manifests/init.pp | 32 |
1 files changed, 32 insertions, 0 deletions
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'] + } + } } |