I'm experiencing this error on a template:
Failed to parse template mailman/mm_cfg.py.erb:#012 Filepath: /etc/puppet/modules/mailman/templates/mm_cfg.py.erb#012 Line: 103#012 Detail: undefined method `each' for "
example1.com\", \"
example2.com\", \"
example3.com":String#012
The line in question in the template looks like this:
POSTFIX_STYLE_VIRTUAL_DOMAINS = [<% @virtualhost.join('", "').each do |v| %>"<%= @v %>"<% end -%>]
The class mailman contains like this:
class mailman ( $defaulthost,
$virtualhost = [],
$postfix = false) {
file { "/etc/mailman/mm_cfg.py":
owner => "root", group => "root", mode => "0644",
content => template("mailman/mm_cfg.py.erb"),
require => [ Package["mailman"], Class["mta"] ],
}
}
And it's called like this:
class {"mailman":
defaulthost => "
example1.com",
virtualhost => ["
example1.com", "
example2.com", "
example3.com"],
postfix => true,
}
So why has this virtualhost array suddenly become a string
when I call the each function on it in the template?
This all worked fine with an older version of puppet master (not sure
which version exactly), but it's broken now with more recent
versions (puppet master 3.5.1, the agent is still running 2.7.23
however).
What could be wrong here?
--
Frederik Himpe