Open jelmer opened 12 months ago
That seems reasonable - updated to address your feedback.
@githubixx any more thoughts on this?
@jelmer Sorry, I'm currently a little bit short on time. I'll get back to you next week. I need to test the patch first to make sure it has no side effects. But it'd be helpful if you could extend the Molecule test accordingly. You don't have to execute it. It's just for me to have a starting point. Maybe make a copy of the Ubuntu 22.04 host and put it here with adjusted values. And the add the needed variable at the end here. Thanks!
updated to resolve conflicts; I hope to get to adding tests sometime this month
@jelmer Hello. Thanks for getting back at this. I am in dire need of this change :) I wanted to make tests to get this going so Ill paste my change here, if it helps you anyhow:
- - name: There should be as much WireGuard interfaces as hosts in vpn group minus one
+ - name: There should be as many WireGuard interfaces as hosts in vpn group minus one or as defined peers
ansible.builtin.assert:
that:
- - "hosts_count|int -1 == wireguard__interfaces_count.stdout|int"
+ - >
+ (wireguard_include_peers is defined and
+ wireguard__interfaces_count.stdout|int == wireguard_include_peers|length) or
+ (wireguard_include_peers is not defined and
+ hosts_count|int - 1 == wireguard__interfaces_count.stdout|int)
This allows explicitly setting which peers a node can connect to. If the variable is not present, then all peers are included.
Fixes #195