- Where Developers Learn, Share, & Build Careers


I need to deploy a file 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.

But it is unnecessary that I would like to announce the big file as the function of two other people.

When I needed the 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.

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 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.

Any ideas for how to overcome redundancy?

If you use a template, then I think you can run with it. For example

  template "/var/tmp/fileC.txt" source "fileC.erb" variable (: include_files => ["/var/tmp/file1.txt", "/ / Var / tmp / file2.txt"]) End   

and then in your template

  and lt;% @ include_files.each {| File | & Gt%; & Lt;% = File.read (file)% & gt; & Lt;%}% & gt;    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -