How do I declare a Chef file resource whose contents depend on cookbook files? -
I need to deploy a file But it is unnecessary that I would like to announce the big file as the function of two other people. When I needed the I tried to use the information of Ruby objects where the cookbook can be deployed. But the more I saw, the more I believed that my chef / ruby is possible with the level of knowledge. The resource provider gap looks very broad. I would like to avoid the solution of the Any ideas for how to overcome redundancy? If you use a template, then I think you can run with it. For example and then in your template fileC which is a combination of two other files < Code> fileA and
fileB . In my current setup, the three files are in the cookbook, which has been declared a cookbook file resource.
fileC before, I found the file resource's content to be "almost done" by destroying
IO.read (file1) + IO.read (file2) as . But as soon as the recipe is deployed to a node, because
fileA and
fileB are not present at the compilation time.
cat fileA fileB> fileC type for the following reason: In the future, I will need to reduce nodes which require nodes from C That is, that requires A / B.
template "/var/tmp/fileC.txt" source "fileC.erb" variable (: include_files => ["/var/tmp/file1.txt", "/ / Var / tmp / file2.txt"]) End
and lt;% @ include_files.each {| File | & Gt%; & Lt;% = File.read (file)% & gt; & Lt;%}% & gt;
Comments
Post a Comment