Q: does puppet epp template syntax support elsif
conditionals?
I am receiving the following error when building a template with puppet epp:
Evaluation Error: Error while evaluating a Function Call, epp(): Invalid EPP: Syntax error at 'elsif'
It seems like puppet syntax should support the use of elsif here. I've looked around and can't seem to see much on this topic.
My template:
<% if $facts[env] == test { %> foo:
<% if $facts[site] == uk { %> bar uk: <% } %>
<% elsif $facts[site] == fr { %> bar fr: <% } %>
<% else $facts[site] == us { %> bar us: <% } %>
<% } %>
Latest Edits:
Along with John Bollinger's helpful comments below, there shouldn't be any conditions outside of the else. If there are, Puppet throws the misleading error message above. So for my use-case the below works well:
<%
if $facts[env] == test {
%> foo:
<%
if $facts[site] == uk {
%> bar uk: <%
} elsif $facts[site] == fr {
%> bar fr: <%
} else {
%> bar us: <%
}
}
%>