]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ferm/templates/me.conf.erb
55b27e20cff336b5f02c1effd01a097a0547288c
[dsa-puppet.git] / modules / ferm / templates / me.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 <%=
7 out = []
8
9 restricted_purposes = {'kvm host', 'central syslog server', 'puppet master', 'jumphost'}
10 restrict_ssh = %w{lebrun geo1 geo2 geo3 beethoven tchaikovsky schroeder rossini draghi}
11
12 if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('purpose')) then
13         scope.lookupvar('site::nodeinfo')['ldap']['purpose'].each do |purp|
14                 if restricted_purposes.include?(purp) then
15                         restrict_ssh << hostname
16                 end
17         end
18 end
19
20 ssh4allowed = []
21 ssh6allowed = []
22
23 if restrict_ssh.include?(hostname) then
24         ssh4allowed  << %w{$DSA_IPS $HOST_NAGIOS_V4 $HOST_DB_V4}
25         ssh6allowed << %w{$DSA_V6_IPS $HOST_NAGIOS_V6 $HOST_DB_V6}
26 end
27 if %w{lebrun schroeder}.include?(hostname) then
28         out << '@def $CARNET = ( 193.198.184.8/29 161.53.160.133 161.53.160.90 161.53.11.222 161.53.12.134 161.53.12.142 161.53.12.143 );'
29         ssh4allowed << '$CARNET'
30         ssh4allowed << '$BUILDD_SSH_ACCESS'
31 end
32 if %w{beethoven draghi}.include?(hostname) then
33         ssh4allowed << '$HOST_DEBIAN_V4'
34         ssh6allowed << '$HOST_DEBIAN_V6'
35 end
36 if %w{geo1 geo2 geo3}.include?(hostname) then
37         ssh4allowed << '194.177.211.209' # orff - master
38         ssh6allowed << '2001:648:2ffc:deb:213:72ff:fe69:e188' # orff - master
39 end
40 if %w{pasquini tristano}.include?(hostname) then
41         ssh4allowed << '206.12.19.23'    # ganeti2.debian.org
42         ssh4allowed << '206.12.19.213'   # tristano.debian.org
43         ssh4allowed << '206.12.19.217'   # pasquini.debian.org
44         ssh4allowed << '192.168.2.23'    # ganeti2.debprivate-ubc.debian.org
45         ssh4allowed << '192.168.2.213'   # tristano-mnt.debprivate-ubc.debian.org
46         ssh4allowed << '192.168.2.217'   # pasquini-mnt.debprivate-ubc.debian.org
47 end
48 ssh4allowed.length == 0 and ssh4allowed << '0.0.0.0/0'
49 ssh6allowed.length == 0 and ssh6allowed << '::/0'
50
51 out << "@def $SSH_SOURCES    = (#{ssh4allowed.join(' ')});"
52 out << "@def $SSH_V6_SOURCES = (#{ssh6allowed.join(' ')});"
53
54
55
56
57 smtp4allowed = []
58 smtp6allowed = []
59
60 if not scope.lookupvar('site::nodeinfo')['smarthost'].empty?
61   smtp4allowed << %w{$HOST_MAILRELAY_V4 $HOST_NAGIOS_V4}
62   smtp6allowed << %w{$HOST_MAILRELAY_V6 $HOST_NAGIOS_V6}
63 end
64
65 smtp4allowed.length == 0 and smtp4allowed << '0.0.0.0/0'
66 smtp6allowed.length == 0 and smtp6allowed << '::/0'
67
68 out << "@def $SMTP_SOURCES    = (#{smtp4allowed.join(' ')});"
69 out << "@def $SMTP_V6_SOURCES = (#{smtp6allowed.join(' ')});"
70
71 out.join("\n")
72 %>