You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
commit 4b0524d09934fa9a3a008811315db3174d4c4e18
Author: Craig Dunn <craig@craigdunn.org>
Date: Wed Nov 30 12:15:03 2016 +0100
initial change to enable port ranges (Closes #107)
diff --git a/templates/service.xml.erb b/templates/service.xml.erb
index ac62ff7..50691e0 100644
--- a/templates/service.xml.erb
+++ b/templates/service.xml.erb
@@ -7,7 +7,10 @@
<%- if @port -%>
<%- @port.each do |i| -%>
- <port<% if i['protocol'] -%> protocol="<%= i['protocol'] %>"<% end -%><% if i['port'] -%> port="<%= i['port'] %>"<% end -%> />
+ <%- range = i['port'].split(/:/).map { |p| p.to_i } -%>
+ <%- (range[0]..range[1] || range[0]).each do |p| -%>
+ <port<% if i['protocol'] -%> protocol="<%= i['protocol'] %>"<% end -%> port="<%= p %>" />
+ <%- end -%>
<%- end -%>
In case port is a list of Integers (not checked in code), the statement failes with:
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Failed to parse template firewalld/service.xml.erb:
Filepath: /opt/provision/modules/firewalld/templates/service.xml.erb
Line: 10
Detail: undefined method `split' for 443:Fixnum
at /opt/provision/modules/firewalld/manifests/custom_service.pp:66:16
The text was updated successfully, but these errors were encountered:
elconas
pushed a commit
to elconas/puppet-firewalld
that referenced
this issue
Mar 5, 2017
Regression intruduced by:
In case port is a list of Integers (not checked in code), the statement failes with:
The text was updated successfully, but these errors were encountered: