Issue when running the splunk module for the first time #13
Comments
try to pass forward_server as an array: |
HI Alessandro, The issue is with a missing brackets in the ERB template. After I added more add_forward_server.erb#!/bin/sh File Managed by PuppetAdding forward servers<% *[@forward_server].each do |fs| *-%> Service restart (done here to skip Puppet dependencies hell)/etc/init.d/splunk restart I also would like to ask you how can I generate the inputs.conf using the COuld you please give me an example how I can use the variable
disabled = false
site.ppclass { "splunk" :
[template_outputs] A custom template to use for a custom etc/system/local/outputs.conf fileThe value is used in: content => template($template_outputs),Note that splunk generates autonomously this file and on the forwarderthis is populated with the value of forward_serverI look forward to hearing from you soon. Best Regards, Rafael 2014-04-15 16:09 GMT+10:00 Alessandro Franceschi notifications@github.com:
|
On teh same matter... How can I use the "input::monitor" class inside the site.pp where I Rafael 2014-04-16 9:39 GMT+10:00 Rafael Abdalla triceras@gmail.com:
|
Got the same error when RSpec testing a class that included the splunk class:
Passing forward_server as an array fixed it:
I submitted a pull request that updates |
+1, thanks |
Thanks! I guess this issue can be marked as closed. |
good |
Hi Aleassandro,
I am running your puppet module for splunk and I am getting an error related to some misconfiguration on the ERB template "add_forward_server.erb". The error message I am getting when running the puppet agent is the following:
?Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template splunk/add_forward_server.erb:
Filepath: /etc/puppetlabs/puppet/modules/splunk/templates/add_forward_server.erb
Line: 5
Detail: undefined method `each' for "lxexhindladev81.pexa:9997":String
at /etc/puppetlabs/puppet/modules/splunk/manifests/init.pp:397 on node bat02-shr.pexa
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run"
My site.pp is the following:
class { "splunk" :
install => "forwarder",
forward_server => "lxexhindladev81.pexa:9997",
install_source => "/pexa/SOE_applicator/general/splunk/splunk-5.0.1-143156-Linux-x86_64.tgz",
disable => false,
}
The ERB template content is:
!/bin/sh
File Managed by Puppet
Adding forward servers
<% @forward_server.each do |fs| -%>
<%= scope.lookupvar('splunk::basedir') %>/bin/splunk add forward-server <%= fs %> --accept-license --answer-yes --auto-ports --no-prompt -auth admin:<%= scope.lookupvar('splunk::admin_password') %>
<% end -%>
Service restart (done here to skip Puppet dependencies hell)
/etc/init.d/splunk restart
Please let me know if you need any further information. I can provide you with the manifest files if you require.
Thanks,
Rafael
The text was updated successfully, but these errors were encountered: