Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of pre shared keys per peer #178

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

daanh432
Copy link

@daanh432 daanh432 commented Jan 31, 2023

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.

@githubixx
Copy link
Owner

@daanh432 Are you still working on this? Otherwise I think it'd make sense to close it for now.

@daanh432
Copy link
Author

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.

@Unit193
Copy link

Unit193 commented Jul 15, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants