Chef: append to an exsting file from an "erb" template

user6012237

Is there a way to append an erb code to a config file:

    <% @zookeeper.each_with_index do |ip, id| %>
    <%= "server.#{id}=#{ip}:2888:3888" %>
    <% end %>
coderanger

No, this is not a feature Chef supports directly. The template resource expects to control the entire file contents. This ensures idempotence and convergence.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Chef Ruby loop over attributes in an .erb template file

From Dev

Defining a Chef ERB template method

From Dev

How to transform from erb file to my config file only in Chef?

From Dev

Setting chef vault variable in template.erb

From Dev

specifying erb template file encoding

From Dev

specifying erb template file encoding

From Dev

In Chef how to Create a template in append mode

From Dev

Rails js.erb file and append

From Dev

Rails js.erb file and append

From Dev

How to Split the AWS OpsWork output string in Chef .erb file.?

From Dev

Liquid::Template... is not visible in the mailer erb file

From Dev

Chef newline in ERB templates

From Dev

Chef newline in ERB templates

From Dev

ERB template not picking up variables from hieradata

From Dev

PDF from ERB template with PDFKit and Rails

From Dev

Chef Powershell Run from File

From Dev

Pass a variable from bash into chef template

From Dev

From js.erb file function call

From Dev

Access a Chef data bag from an attributes file

From Dev

Copy file from chef client node to workstation

From Dev

Get one file from git using chef

From Dev

Generate then read contents from a file chef

From Dev

Append to Chef array attribute

From Dev

Test an ERB Template

From Dev

Suppressing spaces in ERB template

From Dev

Django - Append a reusable template from javascript

From Dev

Append template from a XSLT into another XSLT

From Dev

Append to File & Read from File, but nothing happens

From Dev

Chef: Running chef-client during knife upload / knife role from file