- out=''
- case hostname
- when 'schroeder' then
- 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 );'
- end
- out
-%>
-
-@def $SSH_SOURCES = (<%=
-
-sshallowed = []
-
-case hostname
- when 'logtest01', 'geo1', 'geo2', 'geo3', 'bartok', 'beethoven', 'tchaikovsky' then sshallowed << [ '$DSA_IPS', '$HOST_NAGIOS_V4', '$HOST_DB_V4' ]
- when 'schroeder' then sshallowed << [ '$DSA_IPS', '$HOST_NAGIOS_V4', '$HOST_DB_V4', '$CARNET' ]
+nodeinfo = scope.lookupvar('deprecated::nodeinfo')
+out = []
+
+restricted_purposes = ['kvm host', 'ganeti/kvm host', 'central syslog server', 'puppet master', 'jumphost', 'buildd', 'static-mirror', 'anycast mirror']
+restrict_ssh = %w{tchaikovsky draghi adayevskaya static-master-grnet-01 static-master-ubc-01 geo1 geo2 geo3 denis}
+
+if (nodeinfo['ldap'].has_key?('purpose')) then
+ nodeinfo['ldap']['purpose'].each do |purp|
+ if restricted_purposes.include?(purp) then
+ restrict_ssh << @hostname
+ end
+ end