From: Peter Palfrader Date: Wed, 2 Mar 2011 12:05:16 +0000 (+0100) Subject: Try to get rid of mxinfo again X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=d74ea90d30d778e45ada71d7a0059b688c546ff7;p=mirror%2Fdsa-puppet.git Try to get rid of mxinfo again --- diff --git a/manifests/site.pp b/manifests/site.pp index 07efa9ca4..e1b67ab20 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -17,8 +17,7 @@ node default { $localinfo = yamlinfo('*', "/etc/puppet/modules/debian-org/misc/local.yaml") $nodeinfo = nodeinfo($fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml") $hosterinfo = whohosts($nodeinfo, "/etc/puppet/modules/debian-org/misc/hoster.yaml") - $allnodeinfo = allnodeinfo("sshRSAHostKey ipHostNumber", "purpose") - $mxinfo = allnodeinfo("mXRecord", "") + $allnodeinfo = allnodeinfo("sshRSAHostKey ipHostNumber", "purpose mXRecord") notice("hoster for ${fqdn} is ${hosterinfo}") include munin-node diff --git a/modules/exim/templates/manualroute.erb b/modules/exim/templates/manualroute.erb index ce22a342b..3e51534d2 100644 --- a/modules/exim/templates/manualroute.erb +++ b/modules/exim/templates/manualroute.erb @@ -18,8 +18,9 @@ if nodeinfo['mailrelay'] end mxregex = Regexp.new('^\d+\s+(.*)\.$') -mxinfo.keys.sort.each do |host| - mxinfo[host]['mXRecord'].each do |mx| +allnodeinfo.keys.sort.each do |host| + next unless allnodeinfo[host['mXRecord'] + allnodeinfo[host]['mXRecord'].each do |mx| mxmatch = mxregex.match(mx) if mxmatches.include?(mxmatch[1]) route = host + ":\t\t" + host