From cd22f8da812ebed9dae47065ebc6738dd6aa3791 Mon Sep 17 00:00:00 2001 From: Davide Principi Date: Mon, 23 Sep 2024 14:52:40 +0200 Subject: [PATCH] Upgrade portsadm role for node agents Define the portsadm role during the core upgrade procedure. --- .../cluster/update-core-pre-modules.d/50update_grants | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/imageroot/var/lib/nethserver/cluster/update-core-pre-modules.d/50update_grants b/core/imageroot/var/lib/nethserver/cluster/update-core-pre-modules.d/50update_grants index 92f6bef33b..e6ae964e1f 100755 --- a/core/imageroot/var/lib/nethserver/cluster/update-core-pre-modules.d/50update_grants +++ b/core/imageroot/var/lib/nethserver/cluster/update-core-pre-modules.d/50update_grants @@ -19,6 +19,13 @@ cluster.grants.grant(rdb, action_clause="bind-user-domains", to_clause="account cluster.grants.grant(rdb, action_clause="bind-user-domains", to_clause="accountprovider", on_clause='cluster') cluster.grants.grant(rdb, action_clause="list-modules", to_clause="accountprovider", on_clause='cluster') +# +# Reuse and reallocate TCP/UDP port range #6974 +# +for node_id in set(rdb.hvals('cluster/module_node')): + cluster.grants.grant(rdb, "allocate-ports", f'node/{node_id}', "portsadm") + cluster.grants.grant(rdb, "deallocate-ports", f'node/{node_id}', "portsadm") + # # END of grant updates #