I am using puppet to manage a varnish server with multiple backends. I am trying to create a loop so that additional backends can be added at a later date. So far I have the following in the erb file:
<% @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 -%>
But when this is run I get the error:
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
What am I doing wrong?