[chef] Why will chef not read a file in a template?


Chronological Thread 
  • From: David Montgomery < >
  • To:
  • Subject: [chef] Why will chef not read a file in a template?
  • Date: Sat, 22 Feb 2014 19:19:21 +0800

What is the deal with chef and trying to read a file?  I mean..the file is there.  The below is in a template. 


 discovery.zen.ping.unicast.hosts: <%=File.read('#{Chef::Config[:file_cache_path]}/unicast_hosts')%>

ls -al /var/chef/cache/
-rw-r--r--  1 root root        19 Feb 22 06:05 unicast_hosts

And yes #{Chef::Config[:file_cache_path]} = /var/chef/cache/



[2014-02-22T06:15:12-05:00] INFO: Sending resource update report (run-id: e5f200ea-5d0b-4652-b02a-3b836357ca5b)
[2014-02-22T06:15:12-05:00] ERROR:

Chef::Mixin::Template::TemplateError (No such file or directory - #{Chef::Config[:file_cache_path]}/unicast_hosts) on line #327:

325:
326:
327: discovery.zen.ping.unicast.hosts: <%=File.read('#{Chef::Config[:file_cache_path]}/unicast_hosts')%>
328:
329:









Archive powered by MHonArc 2.6.16.

§