Index: modules/adblockplus/manifests/log/master.pp |
diff --git a/modules/adblockplus/manifests/log/master.pp b/modules/adblockplus/manifests/log/master.pp |
index 7214a0d0c73f9913eba0de401e4bb1311a2ca37a..c5a4afb54c720996859d5ac4bab35a5ea225db54 100644 |
--- a/modules/adblockplus/manifests/log/master.pp |
+++ b/modules/adblockplus/manifests/log/master.pp |
@@ -1,80 +1,38 @@ |
# == Class: adblockplus::log::master |
# |
-# A server setup to collect and pre-process (i.e. anonymize and combine) |
-# log files using Logstash (https://logstash.net/) pipelines. |
+# A server setup to collect and pre-process log files. This is still a stub, |
+# the generated configuration corresponds to recent package defaults. |
# |
# === Parameters: |
# |
-# [*uplinks*] |
-# A hash of $name => $parameters resembling the servers registry within |
-# file modules/private/hiera/hosts.yaml, which is used by default. |
+# [*ensure*] |
+# Whether the master setup should be 'present' or 'absent', defaults |
+# to $adblockplus::log::ensure. |
# |
# === Examples: |
# |
# class {'adblockplus::log::master': |
-# uplinks => { |
-# 'filter1' => { |
-# ip => '10.8.0.1', |
-# ssh_public_key 'AAA...', |
-# }, |
-# }, |
# } |
# |
class adblockplus::log::master ( |
- $uplinks = hiera('adblockplus::log::master::uplinks', hiera('servers', {})), |
+ $ensure = undef, |
) { |
include adblockplus::log |
- realize(File[$adblockplus::log::directory]) |
- realize(User[$adblockplus::log::user]) |
- |
- # Used as internal constants within adblockplus::log::* resources |
- $data_directory = "$adblockplus::log::directory/data" |
- $uplink_directory = "$adblockplus::log::directory/uplink" |
- $import_script = '/usr/local/bin/adblockplus-log-import' |
- |
- # Mapping hiera values explicitly becomes obsolete with Puppet 3.x |
- class {'logstash': |
- contrib => hiera('logstash::contrib', false), |
- ensure => hiera('logstash::ensure', 'running'), |
- pipelines => hiera('logstash::pipelines', {}), |
- version => hiera('logstash::version', '1.4'), |
- } |
+ include adblockplus::log::processor |
+ include stdlib |
- # Location for input sockets in Logstash pipeline configurations |
- file {$uplink_directory: |
- ensure => 'directory', |
- group => $adblockplus::log::group, |
- mode => 0750, |
- owner => 'logstash', |
- require => [ |
- File[$adblockplus::log::directory], |
- Package['logstash'], |
- User[$adblockplus::log::user], |
- ], |
- } |
+ # Virtual resource from modules/adblockplus/manifests/init.pp |
+ realize(File[$adblockplus::directory]) |
- # Default location for output files in Logstash pipeline configurations |
- file {$data_directory: |
- ensure => 'directory', |
- before => Service['logstash'], |
- group => 'logstash', |
- mode => 0775, |
- owner => 'root', |
- require => [ |
- File[$adblockplus::log::directory], |
- Package['logstash'], |
- ], |
- } |
+ # Virtual resource from modules/adblockplus/manifests/log.pp |
+ realize(File[$adblockplus::log::directory]) |
+ realize(User[$adblockplus::log::user]) |
- # The Python script dispatching incoming logs |
- file {$import_script: |
- ensure => 'present', |
- mode => 0755, |
- require => User[$adblockplus::log::user], |
- source => 'puppet:///modules/adblockplus/log/import.py', |
+ # See modules/fluent/manifests/config.pp |
+ fluent::config {$title: |
+ content => template('adblockplus/log/fluentd/master.conf.erb'), |
+ ensure => pick($ensure, $adblockplus::log::ensure), |
+ name => '50-adblockplus-log-master', |
} |
- |
- # See modules/adblockplus/manifests/log/uplink.pp |
- create_resources('adblockplus::log::uplink', $uplinks) |
} |