From: Stephen Gran Date: Wed, 6 May 2009 23:43:44 +0000 (+0100) Subject: Add mail_port and reservedaddrs, and do a little cleanup X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=5c2dbde93f79c031ac7325ddf8e3eb6d37eef161;p=mirror%2Fdsa-puppet.git Add mail_port and reservedaddrs, and do a little cleanup Signed-off-by: Stephen Gran --- diff --git a/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb index 91255b218..159b869e9 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb @@ -29,19 +29,21 @@ module Puppet::Parser::Functions end end + results['mail_port'] = '' + results['smarthost'] = '' + results['smarthost_port'] = 587 + results['reservedaddrs'] = '0.0.0.0/8 : 127.0.0.0/8 : 10.0.0.0/8 : 169.254.0.0/16 : 172.16.0.0/12 : 192.0.0.0/17 : 192.168.0.0/16 : 224.0.0.0/4 : 240.0.0.0/5 : 248.0.0.0/5' + + if yaml.has_key?('mail_port') and yaml['mail_port'].has_key?(host) + results['mail_port'] = yaml['mail_port'][host] + end + if yaml.has_key?('need_smarthost') and yaml['need_smarthost'].include?(host) results['smarthost'] = "mailout.debian.org" - results['smarthost_port'] = 587 - else - results['smarthost'] = '' - results['smarthost_port'] = '' end - results['reservedaddrs'] = case host - when "ball.debian.org" - '0.0.0.0/8 : 127.0.0.0/8 : 169.254.0.0/16 : 172.16.0.0/12 : 192.0.0.0/17 : 192.168.0.0/16 : 224.0.0.0/4 : 240.0.0.0/5 : 248.0.0.0/5' - else - '0.0.0.0/8 : 127.0.0.0/8 : 10.0.0.0/8 : 169.254.0.0/16 : 172.16.0.0/12 : 192.0.0.0/17 : 192.168.0.0/16 : 224.0.0.0/4 : 240.0.0.0/5 : 248.0.0.0/5' + if yaml.has_key?('reservedaddrs') and yaml['reservedaddrs'].has_key?(host) + results['reservedaddrs'] = yaml['reservedaddrs'][host] end ldap = LDAP::Conn.new('db.debian.org') diff --git a/modules/debian-org/misc/local.yaml b/modules/debian-org/misc/local.yaml index 74ba18d4e..2b3c006d2 100644 --- a/modules/debian-org/misc/local.yaml +++ b/modules/debian-org/misc/local.yaml @@ -74,5 +74,12 @@ services: mailrelay: spohr.debian.org rtmaster: spohr.debian.org packagesmaster: powell.debian.org +mail_port: + ancina.debian.org: 2025 + allegri.debian.org: 2025 + piatti.debian.org: 2025 + kassia.debian.org: 587 +reservedaddrs: + ball.debian.org: "0.0.0.0/8 : 127.0.0.0/8 : 10.0.0.0/8 : 169.254.0.0/16 : 172.16.0.0/12 : 192.0.0.0/17 : 192.168.0.0/16 : 224.0.0.0/4 : 240.0.0.0/5 : 248.0.0.0/5" ---