Skip to content

Commit

Permalink
wireguard_server - allow peers to be supplied in UUID-format (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jun 20, 2024
1 parent a1ea6cf commit eecb4fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/module_utils/main/wireguard_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ def _find_peers(self) -> list:
existing[peer['name']] = peer['uuid']

for peer in self.p['peers']:
if peer not in existing:
if peer not in existing and peer not in existing.values():
self.m.fail_json(f"Peer '{peer}' does not exist!")

peers.append(existing[peer])
if peer in existing:
peers.append(existing[peer])

else:
peers.append(peer)

return peers

Expand Down

0 comments on commit eecb4fc

Please sign in to comment.