OLD | NEW |
1 # == Class: adblockplus::log | 1 # == Class: adblockplus::log |
2 # | 2 # |
3 # Default root namespace for integrating custom logging entities. | 3 # Default root namespace for integrating custom logging entities. |
4 # | 4 # |
5 class adblockplus::log { | 5 # === Parameters: |
| 6 # |
| 7 # [*rotations*] |
| 8 # A hash of adblockplus::log::rotation $name => $parameter items |
| 9 # to set up in this context, i.e. via Hiera. |
| 10 # |
| 11 # === Examples: |
| 12 # |
| 13 # class {'adblockplus::log': |
| 14 # rotations => { |
| 15 # # see adblockplus::log::rotation |
| 16 # }, |
| 17 # } |
| 18 # |
| 19 class adblockplus::log ( |
| 20 $rotations = hiera('adblockplus::log::rotations', {}), |
| 21 ) { |
6 | 22 |
7 include adblockplus | 23 include adblockplus |
8 realize(File[$adblockplus::directory]) | 24 realize(File[$adblockplus::directory]) |
9 | 25 |
10 # Used as internal constants within adblockplus::log::* resources | 26 # Used as internal constants within adblockplus::log::* resources |
11 $directory = "$adblockplus::directory/log" | 27 $directory = "$adblockplus::directory/log" |
12 $group = 'log' | 28 $group = 'log' |
13 $user = 'log' | 29 $user = 'log' |
14 | 30 |
15 # Invoke realize(File[$adblockplus::log::directory]) when neccessary | 31 # Invoke realize(File[$adblockplus::log::directory]) when neccessary |
16 @file {$directory: | 32 @file {$directory: |
17 ensure => 'directory', | 33 ensure => 'directory', |
18 require => File[$adblockplus::directory], | 34 require => File[$adblockplus::directory], |
19 } | 35 } |
20 | 36 |
21 # Invoke realize(User[$adblockplus::log::user]) when necessary | 37 # Invoke realize(User[$adblockplus::log::user]) when necessary |
22 @user {$user: | 38 @user {$user: |
23 ensure => 'present', | 39 ensure => 'present', |
24 managehome => true, | 40 managehome => true, |
25 } | 41 } |
| 42 |
| 43 # See modules/adblockplus/manifests/log/rotation.pp |
| 44 create_resources('adblockplus::log::rotation', $rotations) |
26 } | 45 } |
OLD | NEW |