freeradius-clients.tpl 735 Bytes
Newer Older
1 2 3 4 5 6 7 8
## -*- coding: utf-8 -*-
<%!
import re
%>\
% for inst in insts:
% if inst['type'] in (2, 3) and 'clients' in inst:
#{{{${' ' + inst['id'] if 'id' in inst else ''}
% for client in inst['clients']:
9 10 11
% if 'seen' in clients[client]:
# client ${client} defined previously
% else:
12
client ${client} {
13
        secret          = ${clients[client]['secret']}
14
<%
15
ipaddr = re.split(r'/(?=[0-9]{1,2}$)', clients[client]['host'])
16 17 18 19 20 21 22 23 24 25 26
%>\
        ipaddr          = ${ipaddr[0]}
% if len(ipaddr) > 1:
        netmask         = ${ipaddr[1]}
% endif
        nastype         = other
% if 'id' in inst:
        grnetopname     = 1${inst['id']}
% endif
        eduroamspco     = GR
}
27 28 29 30
<%
clients[client]['seen'] = True
%>\
% endif
31 32 33 34
% endfor
#}}}
% endif
% endfor