Drop HOST_PGBACKUPHOST_V4 and HOST_PGBACKUPHOST_V6
[mirror/dsa-puppet.git] / modules / ferm / templates / defs.conf.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ##
5
6 @def &SERVICE($proto, $port) = {
7  proto $proto mod state state (NEW) dport $port ACCEPT;
8 }
9
10 @def &SERVICE_RANGE($proto, $port, $srange) = {
11  proto $proto mod state state (NEW) dport $port @subchain "$port" { saddr ($srange) ACCEPT; }"
12 }
13
14 @def &TCP_UDP_SERVICE($port) = {
15  proto (tcp udp) dport $port ACCEPT;
16 }
17
18 @def &TCP_UDP_SERVICE_RANGE($port, $srange) = {
19  proto (tcp udp) dport $port @subchain "$port" { saddr ($srange) ACCEPT; }"
20 }
21
22 <%
23   rolehost={}
24   allnodeinfo = scope.lookupvar('deprecated::allnodeinfo')
25   roles = scope.lookupvar('deprecated::roles')
26
27   %w{postgres_backup_server}.each do |role|
28     rolehost[role] = []
29     roles[role].each do |node|
30         next unless allnodeinfo.has_key?(node) and allnodeinfo[node].has_key?('ipHostNumber')
31         rolehost[role] << allnodeinfo[node]['ipHostNumber']
32     end
33     rolehost[role].flatten!.sort.uniq
34   end
35
36   dbs = []
37   allnodeinfo.keys.sort.each do |node|
38       next unless allnodeinfo[node].has_key?('ipHostNumber')
39       dbs << allnodeinfo[node]['ipHostNumber']
40   end
41   dbs.flatten!
42 %>
43
44 @def $HOST_PGBACKUPHOST = (<%= rolehost['postgres_backup_server'].uniq.join(' ') %>);
45
46
47 <%
48 def getfastlyranges()
49     begin
50         data = YAML.safe_load(File.open("/srv/puppet.debian.org/puppet-facts/fastly_ranges.yaml").read)
51         return data['addresses']
52     rescue
53         return []
54     end
55 end
56 %>
57 @def $HOST_FASTLY = (<%= getfastlyranges().join(' ') %>);
58
59 @def $HOST_DEBIAN = (<%= dbs.uniq.join(' ') %>);
60
61 @def $weasel  = ();
62 @def $weasel  = ($weasel 86.59.118.144/28); # debian@sil
63 @def $weasel  = ($weasel 86.59.21.32/29); # anguilla1
64 @def $weasel  = ($weasel 86.59.30.32/28); # anguilla2
65 @def $weasel  = ($weasel 213.235.231.192/26); # sil-noreply
66 @def $weasel  = ($weasel 141.201.0.0/16); # uni salzburg
67 @def $weasel  = ($weasel 194.118.0.0/16 62.46.0.0/15); # A1 Telekom
68 @def $weasel  = ($weasel 2001:826:408::/48); # unisbg
69 @def $weasel  = ($weasel 2001:858:10f::/48); # anguilla
70
71 @def $zobel   = ();
72 @def $zobel   = ($zobel 87.139.82.80/32); # exit.credativ.com
73 @def $zobel   = ($zobel 87.193.134.192/27); # credativ qsc
74 @def $zobel   = ($zobel 94.79.138.160/29); # credativ Unitiymedia
75 @def $zobel   = ($zobel 78.47.2.104/29); # baldur, bragi, saga
76 @def $zobel   = ($zobel 217.6.179.48/29); # credativ DTAG
77 @def $zobel   = ($zobel 62.154.226.64/27); # credativ DTAG 2
78 @def $zobel   = ($zobel 92.198.42.24/29); # DG-i Office
79 @def $zobel   = ($zobel 93.94.128.0/21);  # DG-i AS
80 @def $zobel   = ($zobel 195.49.152.0/22); # DG-i AS
81 @def $zobel   = ($zobel 194.187.64.0/22); # DG-i AS
82 @def $zobel   = ($zobel 88.99.108.200/29); # buri, dag, ...
83 @def $zobel   = ($zobel 2001:6f8:1215::/48); # baldur
84 @def $zobel   = ($zobel 2001:6f8:928::/48); # WS2
85 @def $zobel   = ($zobel 2a01:198:549::/48); # WGS20
86 @def $zobel   = ($zobel 2a01:198:6b2::/48); # AdS20
87 @def $zobel   = ($zobel 2a02:158::/32);     # DG-i AS
88 @def $zobel   = ($zobel 2003:5b:203b::/48); # credativ DTAG v6
89 @def $zobel   = ($zobel 2a01:4f8:10a:1504::/64); # buri, dag, ....
90
91 @def $luca    = ();
92 @def $luca    = ($luca 162.210.192.22);  # jump snafu.emyr.net
93 @def $luca    = ($luca 2604:9a00:2010:a041:4:ffff:a2d2:c016); # jump snafu.emyr.net
94
95 @def $tfheen   = ();
96 @def $tfheen   = ($tfheen 178.255.151.162); # vuizook
97 @def $tfheen   = ($tfheen 51.174.0.0/15); # Altibox
98 @def $tfheen   = ($tfheen 2a02:20c8:2640::/64); # vuizook
99 @def $tfheen   = ($tfheen 2a01:798::/29); # Altibox
100
101 @def $jcristau = ();
102 @def $jcristau = ($jcristau 82.255.47.115/32); # home
103 @def $jcristau = ($jcristau 62.210.122.202/32); # topinambour
104 @def $jcristau = ($jcristau 2a01:e35:2ff2:f730::/61); # home
105 @def $jcristau = ($jcristau 2001:bc8:3f1d::/48); # topinambour
106
107 @def $master   = (82.195.75.110 2001:41b8:202:deb:216:36ff:fe40:4001); # master.debian.org
108 @def $people   = (209.87.16.67 2607:f8f0:614:1::1274:67); # paradis.debian.org
109 @def $draghi   = (82.195.75.106 2001:41b8:202:deb:1a1a:0:52c3:4b6a); # draghi.debian.org
110
111 @def $DSA_IPS = ($weasel $zobel $luca $tfheen $jcristau $master $people $draghi);