From 27803b2dcb21abaf755d0bbd50bb6fbc8f998e67 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 13 Aug 2019 16:53:47 +0200 Subject: [PATCH] Handle ipv6 addresses in named.conf.options --- modules/named/templates/named.conf.options.erb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/named/templates/named.conf.options.erb b/modules/named/templates/named.conf.options.erb index cfb1a704c..95370b1c9 100644 --- a/modules/named/templates/named.conf.options.erb +++ b/modules/named/templates/named.conf.options.erb @@ -8,9 +8,13 @@ acl Nagios { roles = scope.lookupvar('site::roles') str = '' roles['nagiosmaster'].each do |node| - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - str += "\t" + ip + "/32;\n" - end + str += scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].collect do |ip| + if ip =~ /:/ + "\t#{ip}/128;\n" + else + "\t#{ip}/32;\n" + end + end.join("") end str-%> }; -- 2.20.1