From e6690fc81befb582bb502ad1b5575cf1247ce736 Mon Sep 17 00:00:00 2001 From: Steffen Zieger Date: Thu, 17 Apr 2014 20:06:54 +0200 Subject: [PATCH] allow multiple ports and listen addresses, refs #33 --- templates/sshd_config.erb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/sshd_config.erb b/templates/sshd_config.erb index 13db0d1a9..74f479699 100644 --- a/templates/sshd_config.erb +++ b/templates/sshd_config.erb @@ -1,11 +1,23 @@ # File is managed by Puppet <%- options = scope.lookupvar('ssh::server::merged_options') -%> <%- if port = options.delete('Port') -%> +<%- if port.is_a?(Array) -%> +<%- port.each do |p| -%> +Port <%= p %> +<%- end -%> +<%- else -%> Port <%= port %> <%- end -%> +<%- end -%> <%- if listen = options.delete('ListenAddress') -%> +<%- if listen.is_a?(Array) -%> +<%- listen.each do |l| -%> +ListenAddress <%= l %> +<%- end -%> +<%- else -%> 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] -%>