Closed danhiris closed 7 years ago
I resolved it by changing the logfile symbol to a string so instead of setting the key of the templates hash like this: templates( logfile: 'logfiletemplate.erb' ) I'm setting it like this: templates( 'logfile' => 'logfiletemplate.erb' )
When I declare templates for the config, I get a no implicit conversion of Symbol into String error.
There appears to be something weird with this but I can't quite pinpoint the issue:
logstash_config[logfile0] action create
================================================================================ Error executing action
create
on resource 'logstash_config[logfile0]'TypeError
no implicit conversion of Symbol into String
Cookbook Trace:
/var/chef/cache/cookbooks/logstash/providers/config.rb:37:in
basename' /var/chef/cache/cookbooks/logstash/providers/config.rb:37:in
block (2 levels) in class_from_file' /var/chef/cache/cookbooks/logstash/providers/config.rb:36:ineach' /var/chef/cache/cookbooks/logstash/providers/config.rb:36:in
block in class_from_file'Resource Declaration:
In /var/chef/cache/cookbooks/usf_mw_logstash/recipes/file_config.rb
7: logstash_config "logfile0" do 8: templates( 9: logfile: 'logfile.conf.erb' 10: ) 11: variables( 12: path: logfile_path, 13: type: log_type, 14: environment: node['usf_mw_logstash']['environment'], 15: app_name: node['usf_mw_logstash']['app_name'], 16: hostname: node['hostname'] 17: ) 18: instance 'logstash' 19: templates_cookbook 'usf_mw_logstash' 20: end 21:
Compiled Resource:
Declared in /var/chef/cache/cookbooks/usf_mw_logstash/recipes/file_config.rb:7:in `block in from_file'
logstash_config("logfile0") do action [:create] retries 0 retry_delay 2 default_guard_interpreter :default declared_type :logstash_config cookbook_name "usf_mw_logstash" recipe_name "file_config" templates {:logfile=>"logfile.conf.erb"} variables {:path=>"/app/data/logs/httpd/access_log", :type=>"apache", :environment=>"sit", :app_name=>"alfresco", :hostname=>"awlsrecmws01"} instance "logstash" templates_cookbook "usf_mw_logstash" end
Platform:
x86_64-linux