ansible-role-wireguard
ansible-role-wireguard copied to clipboard
Implementation of pre shared keys per peer
With a quick search a found this PR #58 that was having a static preshared key for all peers. Preferably your peers all have unique preshared keys, so this is what is implemented in this pull request.
This is a draft implementation of preshared keys per peer.
Newly added peers / hosts in your inventory will automatically be set up with Preshared Keys. Existing peers won't be updated.
I would love to write some automated tests for this. I'm not quite familiar with molecule just yet. So that's a work in progress.
@daanh432 Are you still working on this? Otherwise I think it'd make sense to close it for now.
I have been running the pre shared keys patch for a while now but sadly I did not have the time yet to look into Molecule and writing automated tests. The earliest moment I might have some spare time to look into it would be in July.
Thanks for working on this! This is one of the blockers preventing me from using this role.
In a test setup with preexisting config, when I run the role (with only a few of the endpoints defined), I get the following error:
fatal: [vanir]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 5. list object has no element 5\n\nThe error appears to be in '/home/unit193/.ansible/roles/githubixx.ansible_role_wireguard/tasks/main.yml': line 175, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Set pre shared key fact\n ^ here\n"}
So it would seem having hosts in the target system's config with PSKs that are not yet in ansible config causes this to bail?