Chef infra 厨师长-在模板中重复文本块x次

Chef infra 厨师长-在模板中重复文本块x次,chef-infra,chef-template,Chef Infra,Chef Template,有没有办法在模板中重复相同的文本块X次? 例如,我需要生成带有主机名和文本块的模板 Host1 A lot of text . . HostX A lot of text 使用模板中的每个循环: <%- @hosts.each_with_index do |host, n| -%> Host<%= n %> A lot of text involving <%= host %> etc etc <%- end -%> 主办 大量涉及 等 等

有没有办法在模板中重复相同的文本块X次? 例如,我需要生成带有主机名和文本块的模板

Host1
A lot of text
.
.
HostX
A lot of text

使用模板中的每个
循环:

<%- @hosts.each_with_index do |host, n| -%>
Host<%= n %>
A lot of text involving <%= host %>
etc
etc
<%- end -%>

主办
大量涉及
等
等
您可以在Erb模板中使用任何普通的Ruby流控制