From 43f9fbf3e6499fe786afdec15cf06cd5b32946c5 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sat, 13 Apr 2019 22:09:41 +0200 Subject: [PATCH] More data structure wrangling --- modules/ssh/templates/sshd_config.erb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ssh/templates/sshd_config.erb b/modules/ssh/templates/sshd_config.erb index e51a8f63b..cbc2d0141 100644 --- a/modules/ssh/templates/sshd_config.erb +++ b/modules/ssh/templates/sshd_config.erb @@ -54,10 +54,12 @@ Match Address <%= dbs = [] allnodeinfo.keys.sort.each do |node| next unless allnodeinfo[node].has_key?('ipHostNumber') - if allnodeinfo[node]['ipHostNumber'] =~ ":" - dbs << "#{allnodeinfo[node]['ipHostNumber']}/128" - else - dbs << "#{allnodeinfo[node]['ipHostNumber']}/32" + allnodeinfo[node]['ipHostNumber'].each do |ipnum| + if ipnum =~ ":" + dbs << "#{ipnum}/128" + else + dbs << "#{ipnum}/32" + end end end dbs.flatten.join(',') -- 2.20.1