我正在使用puppet管理具有多个后端的清漆服务器。我正在尝试创建一个循环,以便以后可以添加其他后端。到目前为止,我在erb文件中有以下内容:
<% @backends.each do |backend| -%>
backend <%= backend['backend_name'] %> {
.host = "<%= @backend_addr %>";
.port = "<%= backend['backend_port'] %>";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
<% end -%>
但是当这个运行时我得到错误:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template varnish/drupal.vcl.erb:
Filepath: /etc/puppet/modules/varnish/templates/drupal.vcl.erb
Line: 17
Detail: no implicit conversion of String into Integer
at /etc/puppet/modules/varnish/manifests/init.pp:22 on node x.x.x.x
我做错了什么?