OLD | NEW |
| (Empty) |
1 # == Type: fluent::gem | |
2 # | |
3 # Maintain Fluentd (plugin) gems. | |
4 # | |
5 # Type fluentd::gem is a thin layer around a single Puppet package resource | |
6 # definition, combining the available parameters with ones computed internally | |
7 # (aligned with http://docs.fluentd.org/articles/plugin-management#fluent-gem) | |
8 # and determining the proper default package provider (module fluent includes | |
9 # specialized providers using the gem command that ships with Fluentd, see the | |
10 # *.rb files in modules/fluent/lib/puppet/provider/package for details).# | |
11 # | |
12 # === Parameters: | |
13 # | |
14 # [*ensure*] | |
15 # Translates directly into the package $ensure parameter. | |
16 # | |
17 # [*name*] | |
18 # Translates directly into the package $name parameter. | |
19 # | |
20 # [*provider*] | |
21 # Translates directly into the package $provider parameter. | |
22 # | |
23 # === Examples: | |
24 # | |
25 # fluent::gem {[ | |
26 # 'fluent-plugin-secure-forward', | |
27 # 'fluent-plugin-grep', | |
28 # ]: | |
29 # ensure => 'latest', | |
30 # } | |
31 # | |
32 define fluent::gem ( | |
33 $ensure = 'present', | |
34 $provider = getparam(Package['fluent'], 'name') ? { | |
35 /\btd[_\-]/ => 'td_agent_gem', | |
36 default => 'fluent_gem', | |
37 } | |
38 ) { | |
39 | |
40 include fluent | |
41 include stdlib | |
42 | |
43 # Returns undef if Service['fluent'] is not defined | |
44 $notify = getparam(Service['fluent'], 'ensure') ? { | |
45 /^(running|true)$/ => Service['fluent'], | |
46 default => [], | |
47 } | |
48 | |
49 package {$title: | |
50 ensure => $ensure, | |
51 name => $name, | |
52 notify => $notify, | |
53 provider => $provider, | |
54 require => Package['fluent'], | |
55 } | |
56 } | |
OLD | NEW |