X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=files%2Fetc%2Fpuppet%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fnodeinfo.rb;h=aa641c3cfaa197e53aeb3c346bc7a3109eca337a;hb=e606ae2a7f7259e4c6e42aa88fbc1cd7216036ca;hp=7ffe5a0647dba95d74acc52b7b90e5d5b64ccba4;hpb=0428ca3f71b0e1568157f4d7fb05cfdc012dd35a;p=mirror%2Fdsa-puppet.git diff --git a/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb index 7ffe5a064..aa641c3cf 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb @@ -21,20 +21,38 @@ module Puppet::Parser::Functions end end -# results['bugsmaster'] = host == 'rietz.debian.org' -# results['qamaster'] = host == 'merkel.debian.org' -# results['mailrelay'] = host == 'spohr.debian.org' -# results['rtmaster'] = host == 'spohr.debian.org' -# results['packagesmaster'] = host == 'powell.debian.org' -# -# nodeinfo['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" -# end + if yaml.has_key?('services') + yaml['services'].each_pair do |service, hostlist| + hostlist=[hostlist] unless hostlist.kind_of?(Array) + results[service] = hostlist.include?(host) + end + end + + results['mail_port'] = '' + results['smarthost'] = '' + results['heavy_exim'] = '' + 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" + end + + if yaml.has_key?('reservedaddrs') and yaml['reservedaddrs'].has_key?(host) + results['reservedaddrs'] = yaml['reservedaddrs'][host] + end + + if yaml.has_key?('heavy_exim') and yaml['heavy_exim'].include?(host) + results['heavy_exim'] = "true" + end + + if yaml.has_key?('apache2_defaultconfig') and yaml['apache2_defaultconfig'].include?(host) + results['apache2_defaultconfig'] = "true" + end ldap = LDAP::Conn.new('db.debian.org') @@ -52,3 +70,5 @@ module Puppet::Parser::Functions return(results) end end + +# vim: set fdm=marker ts=2 sw=2 et: