Hi
I am busy writing puppet modules for logstash, and want to export tokens I get from the hiera application or %{calling_module} role.
So each of my applications/modules that will make use of the shipper module and have the inputs.conf file installed and populated will have the following:
class name::deployment inherits name::params {
include logstash::shipper
}
The token I want to export for each app/module is:
$logstash_logs = hiera('logstash_logs')
And this is taken from the %{calling_module} role like:
logstash_logs:
javabridge: 'javabridge-log.log'
actions_javabridge: 'ual/actions-javabridge.log'
The template that is deployed via logstash::shipper has:
<% @logstash_logs.each_pair do |key, value| -%>
file {
type => "<%= key %>"
path => [ "<%= logdir %>/<%= value %>" ]
tags => [ "<%= key %>" ]
}
<% end -%>
Unfortunately the name:deployment class that is calling include logstash::shipper is not passing the tokens.
The error I get is:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template logstash/input.conf.erb:
Filepath: /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb
Line: 81
Detail: Could not find value for 'logstash_logs' at /etc/puppet/environments/bstanding/modules/logstash/templates/input.conf.erb:1
at /etc/puppet/environments/bstanding/modules/logstash/manifests/shipper.pp:15 on node
free-4574-u37.dev.marinsw.netWarning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Any idea how best to achieve this, keeping in mind that I will need to export different options for each module / app I am deploying with the shipper?
Many thanks.