bundlewrap/bundles/nfs-server/metadata.py

37 lines
795 B
Python
Raw Normal View History

from bundlewrap.metadata import atomic
2020-11-12 18:59:02 +00:00
defaults = {
'apt': {
'packages': {
2022-02-18 21:18:44 +00:00
'nfs-server': {
'needed_by': {
2022-02-18 21:18:44 +00:00
'svc_systemd:nfs-kernel-server',
'action:nfs_reload_shares',
},
2022-02-18 21:18:44 +00:00
},
2020-11-12 18:59:02 +00:00
},
},
}
@metadata_reactor.provides(
'firewall/port_rules',
)
def firewall(metadata):
ips = set()
for share_items in metadata.get('nfs-server/shares', {}).values():
for share_target in share_items:
ips.add(share_target)
return {
'firewall': {
'port_rules': {
'111': atomic(ips),
'111/udp': atomic(ips),
'2049': atomic(ips),
'35295': atomic(ips),
},
},
}