bundles/wireguard: only try to auto-generate ips and ports if nodes are present in WG_AUTOGEN_NODES
This commit is contained in:
parent
0d79216ae5
commit
d47f7db708
1 changed files with 6 additions and 0 deletions
|
@ -91,6 +91,9 @@ def peer_pubkeys(metadata):
|
|||
'wireguard/peers',
|
||||
)
|
||||
def peer_ips_and_ports(metadata):
|
||||
if node.name not in repo.libs.s2s.WG_AUTOGEN_NODES:
|
||||
raise DoNotRunAgain
|
||||
|
||||
peers = {}
|
||||
base_port = 51820
|
||||
|
||||
|
@ -100,6 +103,9 @@ def peer_ips_and_ports(metadata):
|
|||
except NoSuchNode:
|
||||
continue
|
||||
|
||||
if rnode.name not in repo.libs.s2s.WG_AUTOGEN_NODES:
|
||||
continue
|
||||
|
||||
ip_a, ip_b = repo.libs.s2s.get_subnet_for_connection(repo, *sorted({node.name, peer_name}))
|
||||
|
||||
if peer_name < node.name:
|
||||
|
|
Loading…
Reference in a new issue