X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fferm%2Ftemplates%2Fdefs.conf.erb;h=5f6a1413fe16f00325f610549762dbe38b41ff5f;hb=a39a00241c07209c62054237980142c1269237cb;hp=d5734dfd7fe97ddf3a668e89baa0a46ce751812b;hpb=c6872f30223f23afe81c6905a061a6a5c38a22f7;p=dsa-puppet.git diff --git a/modules/ferm/templates/defs.conf.erb b/modules/ferm/templates/defs.conf.erb index d5734dfd..5f6a1413 100644 --- a/modules/ferm/templates/defs.conf.erb +++ b/modules/ferm/templates/defs.conf.erb @@ -12,187 +12,93 @@ } @def &TCP_UDP_SERVICE($port) = { - proto (tcp udp) mod state state (NEW) dport $port ACCEPT; + proto (tcp udp) dport $port ACCEPT; } @def &TCP_UDP_SERVICE_RANGE($port, $srange) = { - proto (tcp udp) mod state state (NEW) dport $port @subchain "$port" { saddr ($srange) ACCEPT; }" + proto (tcp udp) dport $port @subchain "$port" { saddr ($srange) ACCEPT; }" } -@def $HOST_MAILRELAY_V4 = (<%= - mailrelay = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['mailrelay'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /:/ - mailrelay << ip - end - end +<% + rolehost={} + allnodeinfo = scope.lookupvar('site::allnodeinfo') + roles = scope.lookupvar('site::roles') + + %w{mailrelay nagiosmaster extranrpeclient muninmaster dbmaster static_mirror static_source static_master dns_geo}.each do |role| + rolehost[role] = [] + roles[role].each do |node| + rolehost[role] << allnodeinfo[node]['ipHostNumber'] + end + rolehost[role].flatten!.sort.uniq end - mailrelay.join(' ') -%>); - -@def $HOST_MAILRELAY_V6 = (<%= - mailrelay = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['mailrelay'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /\./ - mailrelay << ip - end - end + dbs = [] + allnodeinfo.keys.sort.each do |node| + next unless allnodeinfo[node].has_key?('ipHostNumber') + dbs << allnodeinfo[node]['ipHostNumber'] end + dbs.flatten! +%> - mailrelay.join(' ') -%>); - +@def $HOST_MAILRELAY_V4 = (<%= scope.function_filter_ipv4([rolehost['mailrelay']]).uniq.join(' ') %>); +@def $HOST_MAILRELAY_V6 = (<%= scope.function_filter_ipv6([rolehost['mailrelay']]).uniq.join(' ') %>); @def $HOST_MAILRELAY = ( $HOST_MAILRELAY_V4 $HOST_MAILRELAY_V6 ); -@def $HOST_NAGIOS_V4 = (<%= - nagii = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['nagiosmaster'] or scope.lookupvar('site::localinfo')[node]['extranrpeclient'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /:/ - nagii << ip - end - end - end - - nagii.join(' ') -%>); - -@def $HOST_NAGIOS_V6 = (<%= - nagii = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['nagiosmaster'] or scope.lookupvar('site::localinfo')[node]['extranrpeclient'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /\./ - nagii << ip - end - end - end - - nagii.join(' ') -%>); - +@def $HOST_NAGIOS_V4 = (<%= scope.function_filter_ipv4([rolehost['nagiosmaster'] + rolehost['extranrpeclient']]).uniq.join(' ') %>); +@def $HOST_NAGIOS_V6 = (<%= scope.function_filter_ipv6([rolehost['nagiosmaster'] + rolehost['extranrpeclient']]).uniq.join(' ') %>); @def $HOST_NAGIOS = ( $HOST_NAGIOS_V4 $HOST_NAGIOS_V6 ); -@def $HOST_MUNIN_V4 = (<%= - munins = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['muninmaster'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /:/ - munins << ip - end - end - end - - munins.join(' ') -%>); - -@def $HOST_MUNIN_V6 = (<%= - munins = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['muninmaster'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /\./ - munins << ip - end - end - end - - munins.join(' ') -%>); - +@def $HOST_MUNIN_V4 = (<%= scope.function_filter_ipv4([rolehost['muninmaster']]).uniq.join(' ') %>); +@def $HOST_MUNIN_V6 = (<%= scope.function_filter_ipv6([rolehost['muninmaster']]).uniq.join(' ') %>); @def $HOST_MUNIN = ( $HOST_MUNIN_V4 $HOST_MUNIN_V6 ); -@def $HOST_DB_V6 = (<%= - dbs = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['dbmaster'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /\./ - dbs << ip - end - end - end - - dbs.join(' ') -%>); - -@def $HOST_DB_V4 = (<%= - dbs = [] - scope.lookupvar('site::localinfo').keys.sort.each do |node| - if scope.lookupvar('site::localinfo')[node]['dbmaster'] - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /:/ - dbs << ip - end - end - end - - dbs.join(' ') -%>); - -@def $HOST_DB = ($HOST_DB_V4 $HOST_DB_V6); - -@def $HOST_DEBIAN_V4 = (<%= - dbs = [] - scope.lookupvar('site::allnodeinfo').keys.sort.each do |node| - next unless scope.lookupvar('site::allnodeinfo')[node].has_key?('ipHostNumber') - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /:/ - dbs << ip - end - end +@def $HOST_DB_V4 = (<%= scope.function_filter_ipv4([rolehost['dbmaster']]).uniq.join(' ') %>); +@def $HOST_DB_V6 = (<%= scope.function_filter_ipv6([rolehost['dbmaster']]).uniq.join(' ') %>); +@def $HOST_DB = ( $HOST_DB_V4 $HOST_DB_V6 ); - dbs.join(' ') -%>); +@def $HOST_STATICMASTER_V4 = (<%= scope.function_filter_ipv4([rolehost['static_master']]).uniq.join(' ') %>); +@def $HOST_STATICMASTER_V6 = (<%= scope.function_filter_ipv6([rolehost['static_master']]).uniq.join(' ') %>); +@def $HOST_STATIC_V4 = (<%= scope.function_filter_ipv4([rolehost['static_mirror'] + rolehost['static_source'] + rolehost['static_master']]).uniq.join(' ') %>); +@def $HOST_STATIC_V6 = (<%= scope.function_filter_ipv6([rolehost['static_mirror'] + rolehost['static_source'] + rolehost['static_master']]).uniq.join(' ') %>); -@def $HOST_DEBIAN_V6 = (<%= - dbs = [] - scope.lookupvar('site::allnodeinfo').keys.sort.each do |node| - next unless scope.lookupvar('site::allnodeinfo')[node].has_key?('ipHostNumber') - scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip| - next if ip =~ /\./ - dbs << ip - end - end - - dbs.join(' ') -%>); - -@def $HOST_GANETI_V4 = (206.12.19.213/32 206.12.19.217/32); -@def $HOST_DRBD_V4 = (192.168.2.213/32 192.168.2.217/32); +@def $HOST_DNS_GEO_V4 = (<%= scope.function_filter_ipv4([rolehost['dns_geo']]).uniq.join(' ') %>); +@def $HOST_DNS_GEO_V6 = (<%= scope.function_filter_ipv6([rolehost['dns_geo']]).uniq.join(' ') %>); +@def $HOST_EASYDNS_V4 = (64.68.200.91); +@def $HOST_RCODE0_V4 = (83.136.34.0/27); +@def $HOST_RCODE0_V6 = (2A02:850:8::/47); +@def $HOST_DEBIAN_V4 = (<%= scope.function_filter_ipv4([dbs]).uniq.join(' ') %>); +@def $HOST_DEBIAN_V6 = (<%= scope.function_filter_ipv6([dbs]).uniq.join(' ') %>); @def $HOST_DEBIAN = ($HOST_DEBIAN_V4 $HOST_DEBIAN_V6); + @def $sgran = (91.103.132.24/29 85.158.45.51/32); @def $weasel = (); @def $weasel = ($weasel 86.59.118.144/28); # debian@sil @def $weasel = ($weasel 86.59.21.32/29); # anguilla1 @def $weasel = ($weasel 86.59.30.32/28); # anguilla2 -@def $weasel = ($weasel 141.201.27.0/24); # came -@def $weasel = ($weasel 141.201.123.0/24); # cosy +@def $weasel = ($weasel 141.201.0.0/16); # uni salzburg @def $weasel = ($weasel 62.99.152.176/28); # campus sbg @def $zobel = (); @def $zobel = ($zobel 87.139.82.80/32); # exit.credativ.com @def $zobel = ($zobel 87.193.134.192/27); # credativ qsc +@def $zobel = ($zobel 94.79.138.160/29); # credativ Unitiymedia @def $zobel = ($zobel 78.47.2.104/29); # baldur, bragi, saga @def $zobel = ($zobel 92.198.42.24/29); # DG-i Office @def $zobel = ($zobel 93.94.128.0/21); # DG-i AS @def $zobel = ($zobel 195.49.152.0/22); # DG-i AS @def $zobel = ($zobel 194.187.64.0/22); # DG-i AS @def $luca = (64.71.152.109); -@def $paravoid = (83.212.9.72); # faidon.noc.grnet.gr +@def $paravoid = (62.217.125.135); # scrooge.tty.gr @def $tfheen = (); @def $tfheen = ($tfheen 194.31.39.0/26); # office network @def $tfheen = ($tfheen 195.159.200.122); # home @def $tfheen = ($tfheen 77.40.254.120/29); # home -@def $DSA_IPS = ($sgran $weasel $zobel $luca $paravoid $tfheen); +@def $jcristau = (); +@def $jcristau = ($jcristau 82.225.74.107/32); # home +@def $jcristau = ($jcristau 109.190.107.82/32); # office +@def $master = (82.195.75.110); # master.debian.org +@def $DSA_IPS = ($sgran $weasel $zobel $luca $paravoid $tfheen $jcristau $master); @def $sgran6 = (2001:4b10:100b::/48); @def $sgran6 = ($sgran6 2001:4b10:0000:810b::/64); @@ -206,23 +112,33 @@ @def $zobel6 = ($zobel6 2a01:198:6b2::/48); # AdS20 @def $zobel6 = ($zobel6 2a02:158::/32); # DG-i AS @def $luca6 = (); -@def $paravoid6 = (2001:648:2340:1:225:64ff:fea4:8590); # faidon.noc.grnet.gr +@def $paravoid6 = (2001:648:2ffc:113:dcdb:eeff:fe5c:182b); # scrooge.tty.gr @def $tfheen6 = (); @def $tfheen6 = ($tfheen6 2a02:c0:1013:1::/64); # Office @def $tfheen6 = ($tfheen6 2001:840:f000:4007::/64); # Home, link @def $tfheen6 = ($tfheen6 2001:840:4007::/48); # Home -@def $DSA_V6_IPS = ($sgran6 $weasel6 $zobel6 $luca6 $paravoid6 $tfheen6); +@def $jcristau6 = (2a01:e35:2e14:a6b0::/64); # home +@def $master6 = (2001:41b8:202:deb:216:36ff:fe40:4001); # master.debian.org +@def $DSA_V6_IPS = ($sgran6 $weasel6 $zobel6 $luca6 $paravoid6 $tfheen6 $jcristau6 $master6); @def $USER_christoph = (); -@def $USER_christoph = ($USER_christoph 212.114.250.148/31); +#@def $USER_christoph = ($USER_christoph 212.114.250.148/31); +#@def $USER_christoph = ($USER_christoph 128.111.48.6/32); # U of Cal at Santa Barbara, until 2013-03 @def $USER_aurel32 = (); @def $USER_aurel32 = ($USER_aurel32 88.191.126.93); # hall.aurel32.net @def $USER_aurel32 = ($USER_aurel32 82.232.2.251); # farad.aurel32.net +@def $USER_joerg = (); +@def $USER_joerg = ($USER_joerg 213.146.108.160/29); +@def $USER_joerg = ($USER_joerg 46.4.205.32); +@def $USER_joerg6 = (); +@def $USER_joerg6 = ($USER_joerg6 2a02:248:1005::/48); +@def $USER_joerg6 = ($USER_joerg6 2a01:4f8:131:1520::6667); @def $BUILDD_SSH_ACCESS = (); -@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 194.177.211.200); # grieg -@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 70.103.162.29); # master +@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 5.153.231.18); # wuiet +@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 97.107.116.29); # master @def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 206.12.19.5); # ravel +@def $BUILDD_SSH_ACCESS = ($BUILDD_SSH_ACCESS 82.195.75.110); # new-master @def $FREEBSD_SSH_ACCESS = (); @def $FREEBSD_SSH_ACCESS = ($FREEBSD_SSH_ACCESS $DSA_IPS $BUILDD_SSH_ACCESS); @def $FREEBSD_SSH_ACCESS = ($FREEBSD_SSH_ACCESS $USER_christoph $USER_aurel32); # buildd admins