OLD | NEW |
(Empty) | |
| 1 # == Type: fluent::config |
| 2 # |
| 3 # Maintain Fluentd configuration files. |
| 4 # |
| 5 # Use "@include config.d/*.conf" in the main configuration ($fluent::config) |
| 6 # to include all fragments at once, or "@include config.d/$name.conf" to pick |
| 7 # and choose. |
| 8 # |
| 9 # Type fluent::config is a thin layer around a single Puppet file resource |
| 10 # definition, combining the available parameters with ones computed internally |
| 11 # (aligned with http://docs.fluentd.org/articles/config-file). |
| 12 # |
| 13 # === Parameters: |
| 14 # |
| 15 # [*content*] |
| 16 # Translates directly into the file $content parameter. |
| 17 # |
| 18 # [*ensure*] |
| 19 # Translates directly into the file $ensure parameter. |
| 20 # |
| 21 # [*name*] |
| 22 # Used as basename (without .conf extension or directory path) when |
| 23 # generating the config file $path. |
| 24 # |
| 25 # [*source*] |
| 26 # Translates directly into the file $source parameter. |
| 27 # |
| 28 # [*target*] |
| 29 # Translates directly into the file $target parameter. |
| 30 # |
| 31 # === Examples: |
| 32 # |
| 33 # fluent::config {'example1': |
| 34 # name => 'my_config', |
| 35 # source => 'puppet:///modules/custom/fluentd.conf', |
| 36 # } |
| 37 # |
| 38 # fluent::config {'example2': |
| 39 # ensure => 'link', |
| 40 # target => '/opt/custom-stuff/fluentd.conf', |
| 41 # } |
| 42 # |
| 43 define fluent::config ( |
| 44 $content = undef, |
| 45 $ensure = 'present', |
| 46 $source = undef, |
| 47 $target = undef, |
| 48 ) { |
| 49 |
| 50 include fluent |
| 51 include stdlib |
| 52 |
| 53 file {"fluent::config#$title": |
| 54 content => $content, |
| 55 ensure => $ensure, |
| 56 group => $fluent::group, |
| 57 mode => 0640, |
| 58 notify => Service['fluent'], |
| 59 owner => getparam(File['fluent'], 'owner'), |
| 60 path => "$fluent::directory/config.d/$name.conf", |
| 61 require => File["$fluent::directory/config.d"], |
| 62 source => $source, |
| 63 target => $target, |
| 64 } |
| 65 } |
OLD | NEW |