Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/logstash/manifests/fragment.pp

Issue 29341151: Issue 4019 - Added "Edge" to platform choices in Issues tracker at issues1. (Closed)
Patch Set: Created May 10, 2016, 3:35 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/logstash/files/logstash.sh ('k') | modules/logstash/manifests/init.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/logstash/manifests/fragment.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/logstash/manifests/fragment.pp
@@ -0,0 +1,67 @@
+# == Type: logstash::fragment
+#
+# Manage Logstash (https://logstash.net/) configuration file fragments.
+#
+# === Parameters:
+#
+# [*content*]
+# The configuration as-is, mutually exclusive with $source.
+#
+# [*ensure*]
+# Either 'present' or 'absent'.
+#
+# [*order*]
+# Any index for lexical odering of fragments within the generated file.
+#
+# [*source*]
+# The configuration source location, mutually exclusive with $content.
+#
+# [*target*]
+# The name or resource of the target pipeline configuration.
+#
+# === Examples:
+#
+# logstash::fragment {'input':
+# content => template('custom/pipeline-inputs.erb'),
+# order => 20,
+# target => Logstash::Pipeline['custom'],
+# }
+#
+# logstash::fragment {'filter':
+# content => template('custom/pipeline-filters.erb'),
+# order => 40,
+# target => Logstash::Pipeline['custom'],
+# }
+#
+# logstash::fragment {'output':
+# content => template('custom/pipeline-outputs.erb'),
+# order => 60,
+# target => Logstash::Pipeline['custom'],
+# }
+#
+define logstash::fragment(
+ $content = undef,
+ $ensure = 'present',
+ $order = 10,
+ $source = undef,
+ $target = 'default',
+) {
+
+ if is_string($target) {
+ $pipeline = Logstash::Pipeline[$target]
+ }
+ else {
+ $pipeline = $target
+ }
+
+ $pipeline_title = getparam($pipeline, 'title')
+ $pipeline_id = "logstash::pipeline#$pipeline_title"
+
+ concat::fragment {"logstash::fragment#$title":
+ content => $content,
+ ensure => $ensure,
+ order => $order,
+ source => $source,
+ target => $pipeline_id,
+ }
+}
« no previous file with comments | « modules/logstash/files/logstash.sh ('k') | modules/logstash/manifests/init.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld