2 |
# as we cannot declare the same ressource twice ( ie, python-psycopg2 for example ) |
# as we cannot declare the same ressource twice ( ie, python-psycopg2 for example ) |
3 |
# it is required to place this in a common class |
# it is required to place this in a common class |
4 |
class django_application { |
class django_application { |
5 |
package { ['python-django','python-psycopg2','python-django-auth-ldap']: |
package { ['python-django','python-psycopg2','python-django-auth-ldap']: } |
|
ensure => installed |
|
|
} |
|
6 |
|
|
7 |
file { "custom_backend.py": |
file { "/usr/local/lib/custom_backend.py": |
|
path => "/usr/local/lib/custom_backend.py", |
|
|
ensure => present, |
|
|
owner => root, |
|
|
group => root, |
|
|
mode => 644, |
|
8 |
source => "puppet:///modules/django_application/custom_backend.py", |
source => "puppet:///modules/django_application/custom_backend.py", |
9 |
notify => Service['apache'] |
notify => Service['apache'] |
10 |
} |
} |
12 |
define script() { |
define script() { |
13 |
file { $name: |
file { $name: |
14 |
path => "/usr/local/bin/$name", |
path => "/usr/local/bin/$name", |
|
ensure => present, |
|
|
owner => root, |
|
|
group => root, |
|
15 |
mode => 755, |
mode => 755, |
16 |
source => "puppet:///modules/django_application/$name", |
source => "puppet:///modules/django_application/$name", |
17 |
} |
} |
18 |
} |
} |
19 |
|
|
20 |
script { ['django_create_group.py','django_add_permission_to_group.py']: |
script { ['django_create_group.py','django_add_permission_to_group.py']: } |
|
} |
|
21 |
|
|
22 |
define create_group($path,$module) { |
define create_group($path,$module) { |
23 |
exec { "/usr/local/bin/django_create_group.py $name": |
exec { "/usr/local/bin/django_create_group.py $name": |