bundles/nfs-server: support using node names for shares
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-06-03 07:45:56 +02:00
parent f84e9c533f
commit faf27a3940
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,9 @@
% for path, shares in sorted(node.metadata['nfs-server']['shares'].items()):
${path} ${' '.join(sorted(shares))}
% for share_target, share_options in sorted(shares.items()):
% for ip_list in repo.libs.tools.resolve_identifier(repo, share_target).values():
% for ip in sorted(ip_list):
${path} ${ip}(${share_options})
% endfor
% endfor
% endfor
% endfor

View file

@ -17,7 +17,7 @@ def iptables(metadata):
for share_items in metadata.get('nfs-server/shares', {}).values():
for share_target in share_items:
ips.add(share_target.split('(', 2)[0])
ips.add(share_target)
return {
'iptables': {

View file

@ -118,16 +118,16 @@ nodes['home.nas'] = {
'nfs-server': {
'shares': {
'/storage/download': {
'172.19.138.27/32(rw,all_squash,anonuid=65534,anongid=1012,no_subtree_check)',
'home.downloadhelper': 'rw,all_squash,anonuid=65534,anongid=1012,no_subtree_check',
},
'/storage/nas': {
'172.19.138.0/24(ro,all_squash,anonuid=65534,anongid=65534,no_subtree_check)',
'172.19.138.0/24': 'ro,all_squash,anonuid=65534,anongid=65534,no_subtree_check',
},
'/srv/paperless': {
'172.19.138.29/32(rw,all_squash,anonuid=65534,anongid=65534,no_subtree_check)',
'home.paperless': 'rw,all_squash,anonuid=65534,anongid=65534,no_subtree_check',
},
'/srv/scansnap': {
'172.19.138.0/24(rw,all_squash,anonuid=65534,anongid=65534,no_subtree_check)',
'172.19.138.0/24': 'rw,all_squash,anonuid=65534,anongid=65534,no_subtree_check',
},
},
},