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


Chronological Thread 
  • From: Denis Barishev < >
  • To:
  • Subject: [chef] Re: Why will chef not read a file in a template?
  • Date: Sun, 23 Feb 2014 00:53:42 +0700

Is it okay

that you use single quotes, the value won't be substituted...

Regards,
Dennis

On 22/02/14 18:19, David Montgomery wrote:
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.

§