Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9697020
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/templates/sshd_config.erb b/templates/sshd_config.erb
index a26cb93..7e27f0e 100644
--- a/templates/sshd_config.erb
+++ b/templates/sshd_config.erb
@@ -1,64 +1,64 @@
# File is managed by Puppet
<%-
def bool2str(v)
case v
when true
'yes'
when false
'no'
else
v
end
end
-%>
<%- options = scope.lookupvar('ssh::server::merged_options') -%>
<%- if addressfamily = options.delete('AddressFamily') -%>
AddressFamily <%= addressfamily %>
<%- end -%>
<%- if port = options.delete('Port') -%>
<%- if port.is_a?(Array) -%>
-<%- port.each do |p| -%>
+<%- port.reject{ |x| x.strip.empty? }.each do |p| -%>
Port <%= p %>
<%- end -%>
-<%- else -%>
+<%- elsif not port.strip.empty? -%>
Port <%= port %>
<%- end -%>
<%- end -%>
<%- if listen = options.delete('ListenAddress') -%>
<%- if listen.is_a?(Array) -%>
-<%- listen.each do |l| -%>
+<%- listen.reject{ |x| x.strip.empty? }.each do |l| -%>
ListenAddress <%= l %>
<%- end -%>
-<%- else -%>
+<%- elsif not listen.strip.empty? -%>
ListenAddress <%= listen %>
<%- end -%>
<%- end -%>
<%- options.keys.sort_by{ |sk| (sk.to_s.downcase.include? "match") ? 'zzz' + sk.to_s : sk.to_s }.each do |k| -%>
<%- v = options[k] -%>
<%- if v.is_a?(Hash) -%>
<%= k %>
<%- v.keys.sort.each do |key| -%>
<%- value = v[key] -%>
<%- if value.is_a?(Array) -%>
<%- value.each do |a| -%>
<%- if a != '' -%>
<%= key %> <%= bool2str(a) %>
<%- end -%>
<%- end -%>
<%- elsif value != '' -%>
<%= key %> <%= bool2str(value) %>
<%- end -%>
<%- end -%>
<%- else -%>
<%- if v.is_a?(Array) -%>
<%- v.each do |a| -%>
<%- if a != '' -%>
<%= k %> <%= bool2str(a) %>
<%- end -%>
<%- end -%>
<%- elsif v != :undef and v != '' -%>
<%= k %> <%= bool2str(v) %>
<%- end -%>
<%- end -%>
<%- end -%>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Aug 18, 10:30 PM (5 d, 11 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3324285
Attached To
rSPSSH puppet-saz-ssh
Event Timeline
Log In to Comment