wip
This commit is contained in:
parent
e29e8e2964
commit
946b6c439a
2 changed files with 11 additions and 11 deletions
|
@ -1,15 +1,19 @@
|
||||||
|
<%!
|
||||||
|
def column_width(column, table):
|
||||||
|
return max(map(lambda row: len(row[column]), table)) if table else 0
|
||||||
|
%>\
|
||||||
$TTL 600
|
$TTL 600
|
||||||
@ IN SOA ns.sublimity.de. admin.sublimity.de. (
|
@ IN SOA ns.sublimity.de. admin.sublimity.de. (
|
||||||
2020080302 ;Serial
|
2020080302 ;Serial
|
||||||
1200 ;Refresh
|
1200 ;Refresh
|
||||||
600 ;Retry
|
600 ;Retry
|
||||||
1209600 ;Expire
|
1209600 ;Expire
|
||||||
600 ;Negative response caching TTL
|
600 ;Negative response caching TTL
|
||||||
)
|
)
|
||||||
|
|
||||||
% for record in sorted(records, key=lambda r: (r['name'], r['type'], r['value'])):
|
% for record in sorted(records, key=lambda r: (r['name'], r['type'], r['value'])):
|
||||||
% for part in (record['value'][i:i+255] for i in range(0, len(record['value']), 255)):
|
% for part in (record['value'][i:i+255] for i in range(0, len(record['value']), 255)):
|
||||||
${record['name'].ljust(column_width('name', records))} \
|
${record['name'].rjust(column_width('name', records))} \
|
||||||
IN \
|
IN \
|
||||||
${record['type'].ljust(column_width('type', records))} \
|
${record['type'].ljust(column_width('type', records))} \
|
||||||
"${part}"
|
"${part}"
|
||||||
|
|
|
@ -6,15 +6,11 @@ files['/etc/default/bind9'] = {
|
||||||
'source': 'defaults',
|
'source': 'defaults',
|
||||||
}
|
}
|
||||||
|
|
||||||
def column_width(column, table):
|
|
||||||
return max(map(lambda row: len(row[column]), table)) if table else 0
|
|
||||||
|
|
||||||
for zone, records in node.metadata.get('bind/zones').items():
|
for zone, records in node.metadata.get('bind/zones').items():
|
||||||
files[f'/var/lib/bind/db.{zone}'] = {
|
files[f'/var/lib/bind/db.{zone}'] = {
|
||||||
'source': 'db',
|
'source': 'db',
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': {
|
||||||
'records': records,
|
'records': records,
|
||||||
'column_width': column_width,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue